Open
Description
Setting the maxExceptions
property on a job has no effect. For instance, the following job will be tried 25 times even though it throws an exception every time:
class ProcessPodcast implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $tries = 25;
public $maxExceptions = 3;
public function handle(): void {
throw new Exception('The podcast cannot be processed');
}
}
I believe this is because the base worker class uses the cache to count the number of exceptions (see the markJobAsFailedIfWillExceedMaxExceptions
method). The cache is set with $worker->setCache(..)
in Laravels WorkCommand, but I don't believe this is done in Laravel Bridge.
Metadata
Metadata
Assignees
Labels
No labels