FilamentF
Filament2y ago
Al

How to disable import action job retries?

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 on the worker, but this didn't change the outcome. Additionally, I modified the default job class as follows:

<?php

namespace 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). However, this modification also had no impact.

In the beforeFill method:

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.
Was this page helpful?