Sidekiq: change rate of retry for failed job?

randombits picture randombits · Dec 26, 2013 · Viewed 7.8k times · Source

I have jobs of a particular type that I'd like to have retry more frequently than set by the default Sidekiq interval. Is this currently possible? Ideally the job would retry every 5 seconds for up to a minute. Not entirely sure this is currently something that's trivial to plugin to a Sidekiq job.

Answer

Bart picture Bart · Dec 26, 2013

According to: https://github.com/mperham/sidekiq/wiki/Error-Handling you can do this:

class Worker
  include Sidekiq::Worker

  sidekiq_retry_in do |count|
    5
  end
end