Search code examples
laravelcpanellaravel-queuelaravel-scheduler

how to run `php artisan queue:work` every minute on cpanel?


I made an cronjob in cpanel for once per minute like this:

enter image description here

and make a command for that like this:

enter image description here

as you see I give the artisan path to that.

and in this path :/home/{projcetname}/laravel/app/Console/Kernel.php I wrote the commands.

but queue table is full.

how can I run queue:work for always ?

thanks


Solution

  • You can create an entry in your kernel.php that regularly starts a queue worker with the --stop-when-empty flag. I wrote this technique up a little while back and have used it effectively on several sites https://talltips.novate.co.uk/laravel/using-queues-on-shared-hosting-with-laravel