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

replace redis connection temp var with accessor

This commit is contained in:
Max Spransy 2012-02-09 13:46:30 -06:00
parent 5e04fa3deb
commit 7fc2601421

View file

@ -15,12 +15,10 @@ module Sidekiq
end
def self.connect
r = Redis.connect(:url => url)
if namespace
Redis::Namespace.new(namespace, :redis => r)
Redis::Namespace.new(namespace, :redis => redis_connection)
else
r
redis_connection
end
end
@ -31,5 +29,11 @@ module Sidekiq
def self.url
@url || ENV['REDISTOGO_URL'] || 'redis://localhost:6379/0'
end
private
def self.redis_connection
Redis.connect(:url => url)
end
end
end