ixti / sidekiq-throttled

Concurrency and rate-limit throttling for Sidekiq
MIT License
708 stars 75 forks source link

Temporarily skip queues on too many throttled jobs in a row #163

Closed ixti closed 10 months ago

ixti commented 11 months ago

Brings back "cooldown" queues in case they return throttled jobs only functionality. One can configure the behaviour with:

Sidekiq::Throttled.configure do |config|
  # Period in seconds to exclude queue from polling in case it returned
  # {config.cooldown_threshold} amount of throttled jobs in a row. Set
  # this value to `nil` to disable cooldown manager completely.
  # Default: 2.0
  config.cooldown_period = 2.0

  # Amount of throttled jobs returned from the queue subsequently after which
  # queue will be excluded from polling.
  # Default: 1 (cooldown after first throttled job)
  config.cooldown_threshold = 1
end

Related: https://github.com/ixti/sidekiq-throttled/commit/e5ac58594da7e5631c6c9bf3a076d32a82bc861e Closes: https://github.com/ixti/sidekiq-throttled/pull/160