“如何修复 Laravel 作业尝试次数过多或运行时间过长的问题”

Ram*_*han 5 ubuntu supervisord laravel

我使用队列发送短信。效果很好。接下来,Ubuntu服务器出现的问题是我必须重新安装supervisor。重置之后就出现了这个问题。

Production.ERROR: Illuminate\Queue\MaxAttemptsExceededException: 已尝试排队作业太多次。该作业之前可能已超时。在/home/.../.../vendor/laravel/framework/src/Illuminate/Queue/Worker.php:385

小智 1

我的队列在 Fedora Linux 服务器的主管下运行

在我的supervisord.conf中

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/app/current/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=webapp
numprocs=8
redirect_stderr=true
stdout_logfile=/var/app/current/worker.log
stopwaitsecs=36000
Run Code Online (Sandbox Code Playgroud)

通过这个配置文件,我有你显示的错误,但是当我删除睡眠并尝试像这样的标志时

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/app/current/artisan queue:work 
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=webapp
numprocs=8
redirect_stderr=true
stdout_logfile=/var/app/current/worker.log
stopwaitsecs=36000
Run Code Online (Sandbox Code Playgroud)

错误消失了