In the laravel 4.2 docs it is said that if I want to retry failed job from the failed jobs table I should do:
php artisan queue:retry 5
where 5 is the job id.
How can I retry all failed jobs at once?
You can retry all failed Jobs by running: php artisan queue:retry all . The question is for Laravel 4, but yes.
Laravel queues provide a unified queueing API across a variety of different queue backends, such as Amazon SQS, Redis, or even a relational database. Laravel's queue configuration options are stored in your application's config/queue.php configuration file.
You can retry all failed Jobs by running: php artisan queue:retry all
.
here is official doc: https://laravel.com/docs/7.x/queues#retrying-failed-jobs
Laravel docs says:
To retry all of your failed jobs, use queue:retry with all as the ID:
php artisan queue:retry all
However this doesn't work for me. I get "No failed job matches the given ID.". What I did was I ran a command allowing me to execute php:
php artisan tinker
And wrote this:
for ($i = 100; $i <= 150; $i ++) Artisan::call('queue:retry', ['id' => $i]);
Here 100 and 150 are your failed job IDs range. I used to retreive them from DB dynamically but that won't work if you use another queue driver.
What this does is it loops through the IDs in the range you specified and calls a "php artisan queue:retry XXX" command for every single one of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With