I'm relatively new to handling jobs and queues in Laravel. Despite my efforts, the jobs related to the import action repeatedly fail and continue retrying. I attempted to limit retries by using
--tries=1
--tries=1
on the worker, but this didn't change the outcome. Additionally, I modified the default job class as follows:
<?phpnamespace App\Jobs;use Carbon\CarbonInterface;use Filament\Actions\Imports\Jobs\ImportCsv;class ImportTasksJob extends ImportCsv{ public function getJobRetryUntil(): ?CarbonInterface { return now()->addSecond(1); }}
<?phpnamespace App\Jobs;use Carbon\CarbonInterface;use Filament\Actions\Imports\Jobs\ImportCsv;class ImportTasksJob extends ImportCsv{ public function getJobRetryUntil(): ?CarbonInterface { return now()->addSecond(1); }}
Added
->job(ImportTasksJob::class)
->job(ImportTasksJob::class)
. However, this modification also had no impact.
In the
beforeFill
beforeFill
method:
protected function beforeFill(): void{ try { // do something } catch (\Exception $e) { // The job keeps retrying endlessly when an error occur throw $e; }}
protected function beforeFill(): void{ try { // do something } catch (\Exception $e) { // The job keeps retrying endlessly when an error occur throw $e; }}
The issue persists where the job endlessly retries in the event of an error.