lib/sidekiq/throttled/fetch/unit_of_work.rb in sidekiq-throttled-0.6.2 vs lib/sidekiq/throttled/fetch/unit_of_work.rb in sidekiq-throttled-0.6.3

- old
+ new

@@ -24,11 +24,11 @@ @queue = queue @job = job end # Callback that is called by `Sidekiq::Processor` when job was - # succeccfully processed. Most this is used by `ReliableFetch` + # succeccfully processed. Most likely this is used by `ReliableFetch` # of Sidekiq Pro/Enterprise to remove job from running queue. # # @return [void] def acknowledge # do nothing @@ -50,9 +50,17 @@ # doing to pull the job out of queue. # # @return [void] def requeue Sidekiq.redis { |conn| conn.rpush(QueueName.expand(queue_name), job) } + end + + # Tells whenever job should be pushed back to queue (throttled) or not. + # + # @see Sidekiq::Throttled.throttled? + # @return [Boolean] + def throttled? + Throttled.throttled? job 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). #