diff --git a/lib/sidekiq.rb b/lib/sidekiq.rb index 36cb4cab..a8deb121 100644 --- a/lib/sidekiq.rb +++ b/lib/sidekiq.rb @@ -66,10 +66,10 @@ module Sidekiq def self.redis(&block) raise ArgumentError, "requires a block" if !block - redis_connection.with(&block) + redis_pool.with(&block) end - def self.redis_connection + def self.redis_pool @redis ||= Sidekiq::RedisConnection.create end diff --git a/lib/sidekiq/client.rb b/lib/sidekiq/client.rb index 01a84057..aebfe69b 100644 --- a/lib/sidekiq/client.rb +++ b/lib/sidekiq/client.rb @@ -25,8 +25,8 @@ module Sidekiq @chain end - def initialize(redis_connection = Sidekiq.redis_connection) - @redis_connection = redis_connection + def initialize(redis_pool = Sidekiq.redis_pool) + @redis_pool = redis_pool end ## @@ -139,7 +139,7 @@ module Sidekiq def raw_push(payloads) pushed = false - @redis_connection.with do |conn| + @redis_pool.with do |conn| if payloads.first['at'] pushed = conn.zadd('schedule', payloads.map do |hash| at = hash.delete('at').to_s