Skip to content

Instantly share code, notes, and snippets.

@mrTimofey
Last active March 9, 2018 04:37
Show Gist options
  • Save mrTimofey/5ad1c95d113646d06f1adc6d04cc2e67 to your computer and use it in GitHub Desktop.
Save mrTimofey/5ad1c95d113646d06f1adc6d04cc2e67 to your computer and use it in GitHub Desktop.
Laravel Artisan supervisor queue handler

Enable supervisor service

sudo systemctl enable supervisor
sudo systemctl start supervisor

Create file /etc/supervisor/conf.d/WORKER_NAME-worker.conf with contents:

[program:WORKER_NAME-worker]
process_name=%(program_name)s_%(process_num)02d
directory=SITE_DIR
command=php SITE_DIR/artisan queue:work redis --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=SITE_DIR/storage/logs/worker.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment