Recommended method for Laravel Queue Workers

I am curious as to how other people have set up Laravel Queue Workers with Cleavr.

I have set up a Laravel Queue Worker inside the dashboard, and directly after the “Activate New Deployment” hook in deployment hooks, I have added a “php artisan queue:restart” hook which instructs the Laravel Queue Workers to restart and load the new code.

The issue I have is that if any jobs enter the queue during the deployment, I get an error like the following and the job is skipped.

Failed to open stream: No such file or directory in /home/user/domain/releases/20240710093708078/vendor/composer/ClassLoader.php:576

or:

Could not open input file: /home/user/domain/current/artisan

Any suggestions will be appreciated, possibly stopping the queue and starting it again after the migration has finished?

I am tempted just to switch it to a Laravel Schedule.

Hello @MrL22,

We apologize for any inconvenience caused.

Could you please navigate to Deployments > Deployment Workflow > Quick Commands and add a new command with the following script, then run it:

cd /home/{{ user }}/domain/current
php artisan queue:restart

Additionally, could you let us know the order of the queue:restart hook in your deployment hooks list?

Please send me the name of the workflow via PM so we can investigate the issue further.