1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Verify redis= is given a Hash or ConnectionPool

This commit is contained in:
Mike Perham 2012-04-09 08:56:34 -07:00
parent 96d6c71573
commit 6847d664cc

View file

@ -63,8 +63,10 @@ module Sidekiq
def self.redis=(hash) def self.redis=(hash)
if hash.is_a?(Hash) if hash.is_a?(Hash)
@redis = RedisConnection.create(hash) @redis = RedisConnection.create(hash)
else elsif hash.is_a?(ConnectionPool)
@redis = hash @redis = hash
else
raise ArgumentError, "redis= requires a Hash or ConnectionPool"
end end
end end