sexMaxRetries is very useful but when a job fails it retries immediately. This might not always be the desired behavior. Consider this example:
When trying to download a remote file that might not always be available (remote server is having capacity issues), we should retry to download it after 1 hour.
That's where setRetryAfter would be useful. Right now to achieve this you need to call setExecuteAfter
So by using setMaxRetries(3) and setExecuteAfter('+1 hour') we will attempt 3 times to download a file with a 1 hour pause between them.
sexMaxRetries
is very useful but when a job fails it retries immediately. This might not always be the desired behavior. Consider this example:When trying to download a remote file that might not always be available (remote server is having capacity issues), we should retry to download it after 1 hour.
That's where
setRetryAfter
would be useful. Right now to achieve this you need to callsetExecuteAfter
So by using
setMaxRetries(3)
andsetExecuteAfter('+1 hour')
we will attempt 3 times to download a file with a 1 hour pause between them.