lib/sidekiq/throttled/fetch/unit_of_work.rb in sidekiq-throttled-0.15.1 vs lib/sidekiq/throttled/fetch/unit_of_work.rb in sidekiq-throttled-0.16.0

- old
+ new

@@ -47,12 +47,17 @@ # # @note This is triggered when job was not finished and Sidekiq server # process was terminated. It is a reverse of whatever fetcher was # doing to pull the job out of queue. # + # @param [Redis] pipelined connection for requeing via Redis#pipelined # @return [void] - def requeue - Sidekiq.redis { |conn| conn.rpush(QueueName.expand(queue_name), job) } + def requeue(pipeline = nil) + if pipeline + pipeline.rpush(QueueName.expand(queue_name), job) + else + Sidekiq.redis { |conn| conn.rpush(QueueName.expand(queue_name), job) } + end end # Pushes job back to the head of the queue, so that job won't be tried # immediately after it was requeued (in most cases). #