Queue workers and Supervisor, correct workflow to deploy new features
Hi, I need to setup a web server for a laravel application and I have a doubt about the correct workflow to deploy new features in the future.
My doubt is about queue workers and supervisor, if I deploy new feature run "php artisan queue:restart" is enough to restart the queue workers or is necessary to run another command to restart/update supervisor.
Let me do an example, I need to run these workers with supervisor:
php artisan queue:work --queue=one
php artisan queue:work --queue=two
php artisan queue:work --queue=three
php artisan queue:work --queue=four --sleep=1
and at some point I decide to release a new feature, so I run these commands:
"php artisan down" put the app offline
"git pull" get the new feature
"composer install" install new packages
"npm i" install new packages
"npm run prod" build for production
"php artisan migrate" update DB
"php artisan queue:restart" restart the queue workers
"php artisan up" put the app online
Is this workflow correct or I need to add some supervisor commands in the list ?
After some research I figured out that I need to run "supervisorctl restart laravel_workers:" where "laravel_workers" is the processes group created in the supervisor config file. In this way the workers should restart gracefully.
You may gracefully terminate the master Horizon process on your machine using the horizon:terminate Artisan command. Any jobs that Horizon is currently processing will be completed and then Horizon will exit: