It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks. Amongst those tasks are: The default MAX_ATTE

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-09-07 22:30:13

It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks. Amongst those tasks are:

The default MAX_ATTEMPTS is 25. After this, the job either deleted (default), or left in the database with “failed_at” set. With the default of 25 attempts, the last retry will be 20 days later, with the last interval being almost 100 hours.

The default MAX_RUN_TIME is 4.hours. If your job takes longer than that, another computer could pick it up. It’s up to you to make sure your job doesn’t exceed this time. You should set this to the longest time you think the job could take.

By default, it will delete failed jobs (and it always deletes successful jobs). If you want to keep failed jobs, set Delayed::Job.destroy_failed_jobs = false. The failed jobs will be marked with non-null failed_at.

Note: If your error messages are long, consider changing last_error field to a :text instead of a :string (255 character limit).

Leave a Comment