Skip to content

Commit 5dfbd85

Browse files
committed
fix: fix attempt number on delay forumla
1 parent 1ad931b commit 5dfbd85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

retry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func Retry(ctx context.Context, operation func() error, opts ...Option) error {
110110
select {
111111
case <-ctx.Done():
112112
return err
113-
case <-time.After(cfg.delay * time.Duration(attempt*cfg.delayFactor)):
113+
case <-time.After(cfg.delay * time.Duration((attempt+1)*cfg.delayFactor)):
114114
continue
115115
}
116116
}

0 commit comments

Comments
 (0)