![]() |
Quote:Because a failed job will just exit after writing to queue_jobs_failed table and not return the cron, the CRON does not know the job has finished executing and leaves the cron task open on the server. If the issue persists, the servers task queue quickly becomes overloaded as it starts a new cron every minute, then will eventually "crash". Exactly this problem is described in the dedicated section: https://queue.codeigniter.com/running-queues/#with-cron If you set CRON to run the "queue:work" every minute, then you should definitely use "--stop-when-empty" plus some other flag, like "-max-jobs" or "-max-time" and make sure that the values used will not allow the worker to exceed the time that will trigger the next CRON task. Here, you can check the available options: https://queue.codeigniter.com/commands/#queuework Quote:But, would the Queue class recognise the queue an empty and return the cron even after the case of a failed queue? If after a failed job, there are no other jobs to process, then yes - the queue will exit. If you want to stop the queue when the job fails, then you can simply call this command from your job before throwing an exception. PHP Code: command('queue:stop myqueuename') |
Messages In This Thread |
When Queue Fails - by 68thorby68 - 02-13-2025, 05:48 AM
RE: When Queue Fails - by michalsn - 02-15-2025, 02:06 PM
RE: When Queue Fails - by 68thorby68 - 02-20-2025, 02:59 AM
|