Nevermind. Sometimes it seems I have to post a problem before I realize the simple solution. For anyone else with a similar problem the solution was as simple as wrapping the job in a try/catch. In the catch I log the error and do a $job->delete() so that it doesn't sit there clogging up the queue.
Oct 11, 2014
4
Level 1
How to handle errors in beanstalkd queues
I'm implementing queues in an app and have noticed that if there is a bug in my code that the job doesn't fail and will just hang in the queue. For example, in refactoring my code I had an undeclared variable which threw a php error. The job just hung in the queue until I manually cleared all jobs out of the queue. I thought the job would just fail but it doesn't. Is there a way to handle something like this?
Level 4
You can tell the queue worker how many failed attempts to try before it dumps it in a failed table and moves on. Check the Artisan commands :-)
1 like
Please or to participate in this conversation.