lib/sidekiq/throttled_worker.rb in sidekiq-throttled-worker-0.1.1 vs lib/sidekiq/throttled_worker.rb in sidekiq-throttled-worker-0.1.2
- old
+ new
@@ -14,8 +14,20 @@
config.server_middleware do |chain|
chain.add Sidekiq::ThrottledWorker::Middleware
end
end
end
+
+ def redis=(hash)
+ @redis = if hash.is_a?(ConnectionPool)
+ hash
+ else
+ Sidekiq::RedisConnection.create(hash)
+ end
+ end
+
+ def redis
+ @redis ||= Sidekiq::RedisConnection.create
+ end
end
end
end