lib/sidekiq/throttled/strategy.rb in sidekiq-throttled-0.3.2 vs lib/sidekiq/throttled/strategy.rb in sidekiq-throttled-0.4.0

- old
+ new

@@ -40,12 +40,15 @@ return if @concurrency || @threshold raise ArgumentError, "Neither :concurrency nor :threshold given" end - def dynamic_keys? - (@concurrency && @concurrency.dynamic_keys?) || - (@threshold && @threshold.dynamic_keys?) + # @return [Boolean] whenever strategy has dynamic config + def dynamic? + return true if @concurrency && @concurrency.dynamic? + return true if @threshold && @threshold.dynamic? + + false end # @return [Boolean] whenever job is throttled or not. def throttled?(jid, *job_args) return true if @concurrency && @concurrency.throttled?(jid, *job_args)