diff --git a/Changes.md b/Changes.md index 8060daca..b6b215e6 100644 --- a/Changes.md +++ b/Changes.md @@ -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] diff --git a/lib/sidekiq.rb b/lib/sidekiq.rb index 7ba2c153..362270d0 100644 --- a/lib/sidekiq.rb +++ b/lib/sidekiq.rb @@ -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 diff --git a/lib/sidekiq/version.rb b/lib/sidekiq/version.rb index 3e4e0055..81499b20 100644 --- a/lib/sidekiq/version.rb +++ b/lib/sidekiq/version.rb @@ -1,3 +1,3 @@ module Sidekiq - VERSION = "2.8.0" + VERSION = "2.9.0" end