Skip to content

Commit

Permalink
Drop complex Redis identifier logic in favor of simple inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Feb 15, 2018
1 parent 3a6175e commit 99eb613
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 1 addition & 8 deletions lib/resque/data_store.rb
Expand Up @@ -68,14 +68,7 @@ def respond_to?(method,include_all=false)
# Get a string identifying the underlying server.
# Probably should be private, but was public so must stay public
def identifier
# support 1.x versions of redis-rb
if @redis.respond_to?(:server)
@redis.server
elsif @redis.respond_to?(:nodes) # distributed
@redis.nodes.map { |n| n.id }.join(', ')
else
@redis.client.id
end
@redis.inspect
end

# Force a reconnect to Redis.
Expand Down
6 changes: 1 addition & 5 deletions test/resque_test.rb
Expand Up @@ -281,11 +281,7 @@
assert_equal 3, stats[:queues]
assert_equal 3, stats[:processed]
assert_equal 1, stats[:failed]
if ENV.key? 'RESQUE_DISTRIBUTED'
assert_equal [Resque.redis.respond_to?(:server) ? 'localhost:9736, localhost:9737' : 'redis://localhost:9736/0, redis://localhost:9737/0'], stats[:servers]
else
assert_equal [Resque.redis.respond_to?(:server) ? 'localhost:9736' : 'redis://localhost:9736/0'], stats[:servers]
end
assert_equal [Resque.redis_id], stats[:servers]
end

end
Expand Down

0 comments on commit 99eb613

Please sign in to comment.