Skip to content

Commit 5dc1631

Browse files
author
Jan Seidl
committed
no append
1 parent 2eaab4c commit 5dc1631

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

retry.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ func RetryWithOpts(retryableFunction Retryable, opts RetryOpts) error {
5050
func RetryCustom(retryableFunction Retryable, onRetryFunction OnRetry, opts RetryOpts) error {
5151
var n uint
5252

53-
errorLog := make(errorLog, 0, opts.tries)
53+
errorLog := make(errorLog, opts.tries)
5454

5555
for n < opts.tries {
5656
err := retryableFunction()
5757

5858
if err != nil {
5959
onRetryFunction(n, err)
60-
errorLog = append(errorLog, err)
60+
errorLog[n] = err
6161

6262
delayTime := opts.delay * (1 << (n - 1))
6363
time.Sleep((time.Duration)(delayTime) * opts.units)

0 commit comments

Comments
 (0)