What's the difference between attempts and retries on laravel horizon?

2.4k Views Asked by At

While trying to debug some strange MaxAttemptsExceededException errors, I stumbled upon a strange thing on horizon screen.

For the failed job, it shows

Attempts
5
Retries
0

which means, the job is attempted 5 times but never retried.

Is this a horizon bug? If not how can overcome this issue?

I have

'tries' => 1,
'timeout' => 360,
and 
'retry_after' => 420,

I'm using laravel 8.30.1 and horizon 5.7.0

1

There are 1 best solutions below

0
On BEST ANSWER
Attempts
5
Retries
0

Retries is a Horizon feature, it's not related to tries config or public $tries = 5;.

Attempts: 5 means the job retried 5 times before it was be considered a "failed" job.

If you press the retry button on Horizon dashboard, you will notice that Horizon will create a new job with label Retry of 1d56c51b and the Retries of the previous job now is 1. enter image description here

In the previous job detail, you also see the list of retries jobs. enter image description here