deansatch
2 weeks ago

Restart supervisor during deploy?

Posted 2 weeks ago by deansatch

Can anyone explain to me the best way to keep my queue worker up to date and running as stable as possible?

So for example I have a worker that runs order confirmations which are queued via the database. I have noticed if I make a change to my job scripts whilst the worker is running I have to restart it before it will see those changes.

My worker conf file is pretty simple:


[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/current/artisan queue:work --sleep=10 --tries=6 --daemon
autostart=true
autorestart=true
user=root
numprocs=3
redirect_stderr=true
stderr_logfile=/var/www/storage/supervisor/worker.err.log
stdout_logfile=/var/www/storage/supervisor/worker.log

Should I be adding a deployment hook in envoyer to restart supervisor everytime I deploy new code? Or is that bad? My main worry with that would be what would happen if I had jobs in the jobs table at the time of restart...would they be lost? Any clarification on the whole process would be much appreciated

Thanks

Please sign in or create an account to participate in this conversation.