Manually Retry Job in Delayed_job

Michael Waxman picture Michael Waxman · Jul 22, 2010 · Viewed 38.1k times · Source

Delayed::Job's auto-retry feature is great, but there's a job that I want to manually retry now. Is there a method I can call on the job itself like...

Delayed::Job.all[0].perform

or run, or something. I tried a few things, and combed the documentation, but couldn't figure out how to execute a manual retry of a job.

Answer

The Who picture The Who · Oct 26, 2010

To manually call a job

Delayed::Job.find(10).invoke_job # 10 is the job.id

This does not remove the job if it is run successfully. You need to remove it manually:

Delayed::Job.find(10).destroy