Skip to content
Mike Perham edited this page Nov 13, 2017 · 1 revision

Some of your jobs will fail, it's true. Faktory provides a built-in error handling process: automatic retry with exponential backoff. If your job raises an error, that is considered a failure and the job will be retried in the future. If your job returns normally, that is considered a success.

By default, jobs will retry 25 times (over 21 days). If it does not run successfully, the job will be moved to the Dead set where it must be manually retried. The job will be pruned from the Dead set after 6 months.

You can tune the error handling with the retry attribute:

class SomeJob
  include Faktory::Job
  faktory_options retry: 5

  def perform(...)
  end
end
  • retry: 25 is the default.
  • retry: 5 means only retry this job five times before considering the job dead. That's about an hour of retries.
  • retry: 0 means the job is completely ephemeral. No matter if it fails or succeeds, it will be discarded.
  • retry: -1 means the job will go straight to the Dead set if it fails, no retries.
Clone this wiki locally