Skip to content

Commit

Permalink
Merge pull request #56 from Songkeys/patch-1
Browse files Browse the repository at this point in the history
fix: should call onRetry func if attempt is 0
  • Loading branch information
JaSei authored Apr 11, 2022
2 parents 65a9fd4 + cf47834 commit 27363a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ func Do(retryableFunc RetryableFunc, opts ...Option) error {
if config.attempts == 0 {
for err := retryableFunc(); err != nil; err = retryableFunc() {
n++

config.onRetry(n, err)

<-time.After(delay(config, n, err))
}

Expand Down

0 comments on commit 27363a1

Please sign in to comment.