Hey all,
I'm using delayed_job for a priority queue. I was wondering how do i define what a failed job is?
Thanks.
Hey all,
I'm using delayed_job for a priority queue. I was wondering how do i define what a failed job is?
Thanks.
Failed jobs are deleted by default, just like successful ones. However, you can configure delayed_job to keep them, in which case the failed_at column will be populated with the time of the last failure. Then you simply check if failed_at is nil or not. With the default behaviour, I haven't found a way to tell a successful job from a failed one.
A failed job is a job that raises an error. If you want the job to fail you can simply raise an error. Sometimes, if I am waiting on something else to finish, instead of failing the job I will put another job in the queue with a run_at
for x time in the future.