Reputation: 2087
I have a project on forge with one queue worker (with database driver).
Currently I need manually restart queue worker after each deploy:
My deployment script:
cd /home/forge/default
git pull origin master
git log -1
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
How extend my script for automatic restart queue worker?
I tried php artisan queue:restart
. But this command just truncate all items in queue. And uptime of worker didn't reset.
Perhaps I can use failed-table
, but I don't know how.
Upvotes: 2
Views: 1499
Reputation: 125
Running php artisan queue:restart
would also restart supervisor and you won't need to do sudo supervisorctl
as a forge user.
Upvotes: 1
Reputation: 2087
Since you're using Laravel forge, I'm assuming you are also using supervisor. You can restart supervisor in your deployment script which will restart all queue workers.
sudo supervisorctl restart all
If you don't want to restart all workers, supervisortctl restart has options too.
restart <name> Restart a process
restart <gname>:* Restart all processes in a group
restart <name> <name> Restart multiple processes or groups
restart all Restart all processes
Upvotes: 2