Laravel 5.1 Queue - How to avoid Queue:work command to fetch the in progress job -
1 queue database drivar.my queue:work command run on everyminute.
i want execute job max 2 attempts , working. issue queue:work cron runs on every minute , if earlier job in progress attempts same job.
how can avoid queue:work command run in-progress job.
thanks
queue:work
not try perform job being performed since gets reserved flag @ start of process. might experiencing fact job failing before next time cron executes, tries same job again forever.
you can use --tries
everytime invoke queue:work
limit amount of attempts job have. if run php artisan queue:work --tries=2
, job attempted execute 3 times and, if fails 3 times, gets added failed_jobs
table.
make sure have prepared environment (database migration) php artisan queue:failed-table
.
Comments
Post a Comment