From f0a09977e06319e2131059a5f1d0809529d20b4f Mon Sep 17 00:00:00 2001 From: "henk.bourgonje" Date: Tue, 28 Sep 2021 13:13:20 +0200 Subject: [PATCH] add the retry counter to the retryTaskIn() function so it actually uses the retry counter specified. --- v1/worker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v1/worker.go b/v1/worker.go index ef6b10b..d42029f 100644 --- a/v1/worker.go +++ b/v1/worker.go @@ -231,6 +231,9 @@ func (worker *Worker) retryTaskIn(signature *tasks.Signature, retryIn time.Durat return fmt.Errorf("Set state to 'retry' for task %s returned error: %s", signature.UUID, err) } + // Decrement the retry counter, when it reaches 0, we won't retry again + signature.RetryCount-- + // Delay task by retryIn duration eta := time.Now().UTC().Add(retryIn) signature.ETA = &eta