欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

local.ERROR: exception 'Symfony\Component\Process\Exception\ProcessTimedOutException' with message 'The process ""D:\xampp\php\php.exe" "artisan" queue:work --queue="default" --delay=0 --memory=128 --sleep=3 --tries=0 --env="local"" 有大用 有大大用

laravel 队列

[2018-04-27 14:16:00] local.ERROR: exception 'Symfony\Component\Process\Exception\ProcessTimedOutException' with message 'The process ""D:\xampp\php\php.exe" "artisan" queue:work  --queue="default" --delay=0 --memory=128 --sleep=3 --tries=0 --env="local"" exceeded the timeout of 60 seconds.' in D:\xampputf8\htdocs\wangzhangaiban\vendor\symfony\process\Process.php:2303

Stack trace:

#0 D:\xampputf8\htdocs\wangzhangaiban\vendor\symfony\process\Process.php(721): 

Laravel queue process timeout error

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.

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.

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.

Any help would be much appreciated.

  • have you tried php artisan queue:listen --timeout=120. I don't see any need to reinvent the wheel if you just need to extent the time that your queue have to run. If you need longer than 5 minutes or so though you may need to post the actual method that is handling the queue jobs. – mschuett Sep 16 '14 at 20:34

2 Answers  正确答案 

Adding --timeout=0 worked for my set up.

UPDATE: The entire command would therefore be php artisan queue:listen --timeout=0.

Hope this helps.

    This is a known bug in Laravel v5.3:

    You should upgrade to v5.5 to fix this problem.

    Another way is hacking the source code as explained here

      来自  https://stackoverflow.com/questions/25877752/laravel-queue-process-timeout-error


      普通分类: