mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Lazy load redis connection pool to avoid unicorn / passenger fork issues [#794]
This commit is contained in:
parent
9360c01aad
commit
b0def215e1
3 changed files with 7 additions and 7 deletions
|
@ -1,9 +1,9 @@
|
|||
Upcoming
|
||||
-----------
|
||||
|
||||
- Lazy load Redis connection pool, you no longer need to specify
|
||||
anything in Passenger or Unicorn's after_fork callback [#794]
|
||||
- Provides ability to hook onto failure after max retries failed. [jkassemi, #780]
|
||||
- Delay on retry moved from constant proc to method call [lulalala, #784]
|
||||
- DSM V compatible symptom definition of developer frustration [colszowka, #782]
|
||||
- Fix bug in pagination link to last page [pitr, #774]
|
||||
- Upstart scripts for multiple Sidekiq instances [dariocravero, #763]
|
||||
- Use select via pipes instead of poll to catch signals [mrnugget, #761]
|
||||
|
|
|
@ -68,15 +68,15 @@ module Sidekiq
|
|||
|
||||
def self.redis(&block)
|
||||
raise ArgumentError, "requires a block" if !block
|
||||
@redis ||= Sidekiq::RedisConnection.create
|
||||
@redis ||= Sidekiq::RedisConnection.create(@hash || {})
|
||||
@redis.with(&block)
|
||||
end
|
||||
|
||||
def self.redis=(hash)
|
||||
return @redis = hash if hash.is_a?(ConnectionPool)
|
||||
|
||||
if hash.is_a?(Hash)
|
||||
@redis = RedisConnection.create(hash)
|
||||
elsif hash.is_a?(ConnectionPool)
|
||||
@redis = hash
|
||||
@hash = hash
|
||||
else
|
||||
raise ArgumentError, "redis= requires a Hash or ConnectionPool"
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Sidekiq
|
||||
VERSION = "2.8.0"
|
||||
VERSION = "2.9.0"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue