Skip to content

Commit

Permalink
Fixing attempt number to start at 1 for actions
Browse files Browse the repository at this point in the history
It'll still start at 0 for strategies.
  • Loading branch information
Rican7 committed Aug 1, 2021
1 parent 14765b8 commit 6d0dd13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func Retry(action Action, strategies ...strategy.Strategy) error {
var err error

for attempt := uint(0); (attempt == 0 || err != nil) && shouldAttempt(attempt, strategies...); attempt++ {
err = action(attempt)
err = action(attempt + 1)
}

return err
Expand Down

0 comments on commit 6d0dd13

Please sign in to comment.