Laravel queue process timeout error(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 队列进程超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Laravel 队列进程超时错误
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01
