Skip to content

Commit cb748ee

Browse files
committed
pass zero max-elapsed-time for infinite retry
fixes #156
1 parent 31e2809 commit cb748ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

retry.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func Retry[T any](ctx context.Context, operation Operation[T], opts ...RetryOpti
119119
}
120120

121121
// Stop retrying if maximum elapsed time exceeded.
122-
if time.Since(startedAt)+next > args.MaxElapsedTime {
122+
if args.MaxElapsedTime > 0 && time.Since(startedAt)+next > args.MaxElapsedTime {
123123
return res, err
124124
}
125125

0 commit comments

Comments
 (0)