From d6c837e439f4c567f8003eab6e423c22900452a8 Mon Sep 17 00:00:00 2001 From: "Lixia (Sylvia) Lei" Date: Mon, 2 Sep 2024 15:31:12 +0800 Subject: [PATCH] refactor: fix seed for retry policy (#821) Minor refactor for #820 Signed-off-by: Lixia (Sylvia) Lei --- registry/remote/retry/policy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/remote/retry/policy.go b/registry/remote/retry/policy.go index 38e015cc..ebe8b373 100644 --- a/registry/remote/retry/policy.go +++ b/registry/remote/retry/policy.go @@ -96,7 +96,7 @@ func ExponentialBackoff(backoff time.Duration, factor, jitter float64) Backoff { return func(attempt int, resp *http.Response) time.Duration { var h maphash.Hash h.SetSeed(maphash.MakeSeed()) - rand := rand.New(rand.NewPCG(h.Sum64(), 0)) + rand := rand.New(rand.NewPCG(0, h.Sum64())) // check Retry-After if resp != nil && resp.StatusCode == http.StatusTooManyRequests {