Laravel 队列进程超时错误

Laravel queue process timeout error(Laravel 队列进程超时错误)
本文介绍了Laravel 队列进程超时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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:

[SymfonyComponentProcessExceptionProcessTimedOutException]                                                                                                                                                                              
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,但这并不理想,因为我确实希望它在以下情况下超时某些过程实际上没有反应.我尝试在作业调用的函数中定期调用 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.

我在网上找到一个线程提到 SymfonyComponentProcessProcess->setTimeout(null),但我不知道如何访问该进程对象,或者这是否可以修复问题.

I found a thread online mentioning SymfonyComponentProcessProcess->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 队列进程超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)