You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
Currently you can specify how many times a job should be retried when starting the queue daemon (using the --tries option). I find this to be limiting. I'd like to specify the number of attempts / tries per job — on the job class (protected $tries = 2; on the job class). Some types of jobs I may want to retry if they fail such as those that communicate with an external API. But other may be candidates for not retrying at all.
Even better would be an API that allows you to queue the job for retry from within the job such as using $this->retry() in your job class. For example, if you are communicating with an external API and your API request fails with a 503 HTTP status code, you may want to catch that exception and retry the job. But if the HTTP status code was 404, you may not want to retry at all as a subsequent attempt would likely yield the same 404 error.
Taking this idea further, retrying with a specified delay: $this->retry(10); // retry after 10 seconds
With Laravel 5.3, if I want to have different numbers of retries / attempts, I must set up different queues. I'd rather use separate queues for job priority, not number of retries. With the API example ($this->retry()), this would be even more flexible as you could retry the job based on your own logic.
The text was updated successfully, but these errors were encountered:
Currently you can specify how many times a job should be retried when starting the queue daemon (using the
--tries
option). I find this to be limiting. I'd like to specify the number of attempts / tries per job — on the job class (protected $tries = 2;
on the job class). Some types of jobs I may want to retry if they fail such as those that communicate with an external API. But other may be candidates for not retrying at all.Even better would be an API that allows you to queue the job for retry from within the job such as using
$this->retry()
in your job class. For example, if you are communicating with an external API and your API request fails with a 503 HTTP status code, you may want to catch that exception and retry the job. But if the HTTP status code was 404, you may not want to retry at all as a subsequent attempt would likely yield the same 404 error.Taking this idea further, retrying with a specified delay:
$this->retry(10); // retry after 10 seconds
With Laravel 5.3, if I want to have different numbers of retries / attempts, I must set up different queues. I'd rather use separate queues for job priority, not number of retries. With the API example (
$this->retry()
), this would be even more flexible as you could retry the job based on your own logic.The text was updated successfully, but these errors were encountered: