Skip to content

Commit

Permalink
add the retry counter to the retryTaskIn() function so it actually us…
Browse files Browse the repository at this point in the history
…es the retry counter specified.
  • Loading branch information
hlippa committed Sep 28, 2021
1 parent 53e2e28 commit f0a0997
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions v1/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0a0997

Please sign in to comment.