Flowdock
method

retry_job

Importance_2
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: Enqueuing

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.0.0.1) is shown here.

These similar methods exist in v6.1.7.7:

retry_job(options={}) public

Reschedules the job to be re-executed. This is useful in combination with the rescue_from option. When you rescue an exception from your job you can ask Active Job to retry performing your job.

Options

  • :wait - Enqueues the job with the specified delay

  • :wait_until - Enqueues the job at the time specified

  • :queue - Enqueues the job on the specified queue

  • :priority - Enqueues the job with the specified priority

Examples

class SiteScraperJob < ActiveJob::Base
  rescue_from(ErrorLoadingSite) do
    retry_job queue: :low_priority
  end

  def perform(*args)
    # raise ErrorLoadingSite if cannot scrape
  end
end
Show source
Register or log in to add new notes.