Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 7 - Stop Processing Jobs and Clear Queue

I have a production system on AWS and use Laravel Forge. There is a single default queue that is processing Jobs.

I've created a number jobs and now wish to delete them (as they take many hours to complete and I realize my input data was bad). I created a new job with good data, but it won't be processed until all the others have finished.

How can I delete all jobs?

It was previously set up using redis queue driver. I could not figure out how to delete jobs, so I switched the driver to database, and restarted the server, thinking that this would at least get the jobs to stop processing. However, much to my dismay, they continue to be processed :-(

I even deleted the worker from the forge ui and restarted the server: the jobs still process.

Why do jobs continue to be processed?

How can I stop them?

like image 786
BizzyBob Avatar asked Dec 12 '25 22:12

BizzyBob


1 Answers

You can use:

php artisan queue:clear redis

It will clear all jobs from default queue on redis connection. If you put jobs in other queue then you should specify queue name for example:

php artisan queue:clear redis --queue=custom_queue_name
like image 74
Marcin Nabiałek Avatar answered Dec 14 '25 15:12

Marcin Nabiałek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!