E
E
E2018-11-30 16:48:26
Laravel
E, 2018-11-30 16:48:26

Laravel queue timeout problem, how to fix?

There is a job class, it has
public $timeout = 172800;
have supervisor config
artisan queue:work database --queue=blah --tries=1
Runs, starts running, then timeout error

Illuminate\Queue\MaxAttemptsExceededException: App\Jobs\Blah has been attempted too many times or run too long. The job may have previously timed out. in /var/www/html/api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:401

I checked it by running the same code in the controller, it is normal there.
even put
...
public function handle()
    {
        ini_set('max_execution_time', 172800);
}
...

he doesn’t care, he stops anyway and the task is thrown into failed_jobs

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bavial, 2019-02-21
@bavial

Try to increase retry_after in config/queue.php in your driver, for example up to 1800. This parameter is responsible for timeout, not for how it is named.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question