laravellaravel-queuelaravel-jobs

Laravel Queue and Jobs - How to re run failed job later on


Thank you in advance

My question is simple

For example, I have created one job which is sending an email to the user. however it is failed due to some syntax error or any other exception, so laravel will consider this job as a failed job in the failed_jobs database table, later on, let's say for an example after 2 days I found the issue in the code and I resolved it, now I want to re-run that failed job again so that my task can be complete

What is the way to do that?


Solution

  • You can run a job more than 1 time

    php artisan queue:work --sleep=1 --tries=5 --timeout=60

    OR

    You can run all failed jobs

    php artisan queue:retry all