Laravel queue process timeout error

Will Durney picture Will Durney · Sep 16, 2014 · Viewed 38.9k times · Source

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.

Answer

David Lemayian picture David Lemayian · Oct 7, 2014

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

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

Hope this helps.