laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.84k stars 645 forks source link

[5.x] Add clear all queues option #1472

Closed TWithers closed 2 months ago

TWithers commented 2 months ago

This PR adds an option to clear all queues: artisan horizon:clear --all-queues

This is ideal for development as Laravel/Horizon apps might have multiple queues and this would provide a quick and easy way to clear all the queues at once instead of calling the horizon:clear command multiple times.

It grabs the default queue, and all the horizon queues from the config and issues the clear command individually to each queue.

This PR also adds a test for the command as there wasn't previously a test.

taylorotwell commented 2 months ago

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!