A
A
Alexey2020-02-13 17:18:58
Redis
Alexey, 2020-02-13 17:18:58

Restarting Laravel jobs. How to overcome?

There is a script that runs for about 5-8 minutes, everything works fine on the local computer, but on the server the script is executed 3 times with an interval of 90 seconds.

Queue settings:

'redis' => [
            'driver' => 'redis',
            'connection' => 'default',
            'queue' => 'default',
            'retry_after' => 900,
            'block_for' => null,
        ],

workers are started by the command
artisan queue:work redis --timeout=900 --sleep=3 --tries=3

Laradoki write that retry_after should help, but alas. Who faced this, how did you overcome it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2020-02-26
@XyM4uK

I will answer myself,
everything turned out to be much simpler, the worker timeout and the retry_after timeout were the same, after I raised the retry_after value to 920 - everything worked as it should

R
Roman Mirilaczvili, 2020-02-21
@2ord

Logs should indicate the reason for what is happening. Perhaps there is a problem with the connection to Redis (DBMS available?) and then there are 3 unsuccessful attempts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question