payload icon indicating copy to clipboard operation
payload copied to clipboard

fix: ensure jobs do not retry indefinitely by default, fix undefined values in error messages

Open AlessioGr opened this issue 1 year ago • 0 comments

Fix default retries

By default, if no retries property has been set, jobs / tasks should not be retried. This was not the case previously, as the maxRetries variable was undefined, causing jobs to retry endlessly. This PR sets them to 0 by default.

Additionally, this will make it so the workflow retries property always takes precedence over the task retries property. If a workflow does not have retries set (= 0), the job will NEVER retry, even if all individual tasks have retries set.

Fix error messages

Previously, you were able to encounter error messages with undefined values like these:

CleanShot 2024-11-28 at 15 23 37@2x

Reason is that it was always using job.workflowSlug for the error messages. However, if you queue a task directly, without a workflow, job.workflowSlug is undefined and job.taskSlug should be used instead.

This PR then gets rid of the second undefined value by ensuring that `maxRetries´ is never undefined

AlessioGr avatar Nov 28 '24 22:11 AlessioGr