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:
parent
166d256b45
commit
7e6e4ef264
1 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ module Sidekiq
|
||||||
class RedisConnection
|
class RedisConnection
|
||||||
def self.create(url = nil, namespace = nil, pool = true)
|
def self.create(url = nil, namespace = nil, pool = true)
|
||||||
@namespace = namespace if namespace
|
@namespace = namespace if namespace
|
||||||
@url = url if url
|
@url = url ? url : nil
|
||||||
if pool
|
if pool
|
||||||
ConnectionPool.new { connect }
|
ConnectionPool.new { connect }
|
||||||
else
|
else
|
||||||
|
@ -27,7 +27,7 @@ module Sidekiq
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.url
|
def self.url
|
||||||
ENV['REDISTOGO_URL'] || (@url = nil)
|
@url || ENV['REDISTOGO_URL'] || 'redis://localhost:6379/0'
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.namespace=(namespace)
|
def self.namespace=(namespace)
|
||||||
|
|
Loading…
Add table
Reference in a new issue