Laravel队列进程超时错误 [英] Laravel queue process timeout error
问题描述
我在Laravel上使用php artisan queue:listen
运行排队的作业.其中一项工作相当耗时,需要很长时间,因此出现以下错误:
I'm on Laravel using php artisan queue:listen
to run queued jobs. One of these jobs is fairly involved and takes a long time, and so I'm getting the following error:
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process ""/usr/local/Cellar/php55/5.5.14/bin/php" artisan queue:work
--queue="QUEUE_URL" --delay=0 --memory=128 --sleep=3 --tries=0"
exceeded the timeout of 60 seconds.
我知道我可以以任意高的超时值运行queue:listen
,但这并不理想,因为我 do 希望它在某些过程实际上是的情况下超时没有反应.我尝试在作业调用的函数中定期调用set_time_limit(60)
,但这并不能解决我的问题.
I know that I could run queue:listen
with an arbitrarily high timeout value, but that's not ideal, as I do want it to time out in the event that some process is actually unreseponsive. I tried regularly calling set_time_limit(60)
within the function called by the job, but that did not solve my problem.
我在网上找到一个提及Symfony\Component\Process\Process->setTimeout(null)
的线程,但是我不知道如何访问该流程对象,或者这是否可以解决问题.
I found a thread online mentioning Symfony\Component\Process\Process->setTimeout(null)
, but I don't know how to access that process object, or if that would even fix the issue.
任何帮助将不胜感激.
推荐答案
添加--timeout=0
可以完成我的设置.
Adding --timeout=0
worked for my set up.
更新:
因此,整个命令将为php artisan queue:listen --timeout=0
.
UPDATE:
The entire command would therefore be php artisan queue:listen --timeout=0
.
希望这会有所帮助.
这篇关于Laravel队列进程超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!