I am using supervisor to run jobs on my lumen 5.2 setup. My supervisor conf. look like this
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/app/artisan queue:work --
queue=server_level,app_level --tries=0 -vvv --daemon
autostart=true
autorestart=true
user=web_user
numprocs=20
redirect_stderr=true
stdout_logfile=/var/www/app/storage/logs/worker.log
when a job fails due to PHP error, Lumen inserts it in delayed queue and tries to run it indefinitely. I have used --tries=0 and expect a job should be failed in case of any error but it keeps re-running forever.
Even if you don't specify the
--tries
option, it takes the value0
as default. Which means jobs will be attempted indefinitely till they're successful. If you want to prevent the jobs from running again after failure, then set the value to 1.