sidekiq-throttled icon indicating copy to clipboard operation
sidekiq-throttled copied to clipboard

Add dynamic cooldown policies

Open ixti opened this issue 6 months ago • 8 comments

Allow Config#cooldown_period and Config#cooldown_threshold to be specified as Proc:

Sidekiq::Throttled.configure do |c|
  c.cooldown_period = lambda do |queue_name|
    queue_name == "default" ? 2.0 : 10.0
  end

  c.cooldown_threshold = lambda do |queue_name|
    queue_name == "mostly-throttled" ? 0 : 10
  end
end

This will go very well in pair with planned push-back strategies PR.

ixti avatar Dec 18 '23 22:12 ixti