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

Add default redis url in redis_connection as fallback

This commit is contained in:
Max Spransy 2012-02-09 09:31:32 -06:00
parent 166d256b45
commit 7e6e4ef264

View file

@ -5,7 +5,7 @@ module Sidekiq
class RedisConnection
def self.create(url = nil, namespace = nil, pool = true)
@namespace = namespace if namespace
@url = url if url
@url = url ? url : nil
if pool
ConnectionPool.new { connect }
else
@ -27,7 +27,7 @@ module Sidekiq
end
def self.url
ENV['REDISTOGO_URL'] || (@url = nil)
@url || ENV['REDISTOGO_URL'] || 'redis://localhost:6379/0'
end
def self.namespace=(namespace)