lib/sidekiq/throttled/strategy/concurrency.rb in sidekiq-throttled-0.10.0.beta vs lib/sidekiq/throttled/strategy/concurrency.rb in sidekiq-throttled-0.10.0
- old
+ new
@@ -40,10 +40,12 @@
@key_suffix || @limit.respond_to?(:call)
end
# @return [Boolean] whenever job is throttled or not
def throttled?(jid, *job_args)
- return false unless (job_limit = limit(job_args))
+ job_limit = limit(job_args)
+ return false unless job_limit
+ return true if job_limit <= 0
kwargs = {
:keys => [key(job_args)],
:argv => [jid.to_s, job_limit, @ttl, Time.now.to_f]
}