framework
framework copied to clipboard
[Proposal] Queue Exception delay
Right now when a job fails due to an exception being thrown the job is immediately released back to the queue.
Maybe if we could set a config option exception_delay with the default amount of delay after an exception is thrown we could reduce the load if a job is released every time it fails.
Right now it does this:
Worker.php
if ( ! $job->isDeleted()) $job->release($delay);
Maybe change it to something like this:
if($delay === 0)
{
$delay = $this->manager->getExceptionDelay();
}
if ( ! $job->isDeleted()) $job->release($delay);
So when a job already has a delay we don't override it but when delay is 0 we override it with the config option.
There are some upcoming changes for a "failed jobs" database table integrated into Laravel that should really solve this problem.