Skip to content

Commit

Permalink
fix: should call onRetry func if attempt is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
songkeys authored Mar 25, 2022
1 parent 65a9fd4 commit cf47834
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 cf47834

Please sign in to comment.