I am using delayed job to perform a job asynchronously at a specific time. This is specified in my model class. Now I need to figure out how to retrive the job in case I need to reschedule the job. It would be nice if I could have a method on my model to retrieve the job and update the run_at time. How can I do this with delayed job?
Share
You can simply work on the Delayed::Job model (say activerecord if you use delayed_job_active_record)
The question is what job you want to retrieve, and how you take care of that.
No matter how you manage your jobs for later retrieval, you should use something like:
This code is surely unsafe, you need to check lock, etc.
Also note that you need to config delayed_job to keep failed jobs (deleted by default after max_attempts failures).