From 9a8c21ac3db4dd5bc4f37e9c21218f2c2d6fc604 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sat, 18 Nov 2023 20:59:55 -0500 Subject: [PATCH] use exponential everywhere --- server/upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/upload.go b/server/upload.go index f4dda888..1ac87af3 100644 --- a/server/upload.go +++ b/server/upload.go @@ -181,7 +181,7 @@ func (b *blobUpload) Run(ctx context.Context, opts *RegistryOptions) { resp, err := makeRequestWithRetry(ctx, http.MethodPut, requestURL, headers, nil, opts) if err != nil { b.err = err - sleep := 200*time.Millisecond + time.Duration(try)*time.Second/4 + sleep := time.Second * time.Duration(math.Pow(2, float64(try))) log.Printf("%s complete upload attempt %d failed: %v, retrying in %s", b.Digest[7:19], try, err, sleep) time.Sleep(sleep) continue