From 5395533688661459f53f31c383a0f57ec5421299 Mon Sep 17 00:00:00 2001 From: Timo Riski Date: Thu, 19 Sep 2024 15:06:23 +0300 Subject: [PATCH] feat: double retryablehttp retry setting values * RetryWaitMin: increase to 2 seconds (library default is 1 second) * RetryWaitMax: increase to 60 seconds (library default is 30 seconds) * RetryMax: increase to 7 (library default is 4) --- client.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client.go b/client.go index e6855fa..a95b3b8 100644 --- a/client.go +++ b/client.go @@ -42,6 +42,17 @@ func NewClient(opts ...Option) (Client, error) { c := retryablehttp.NewClient() c.Logger = nil c.CheckRetry = checkRetry + + // Configure retry settings: 8 attempts in total, 2 seconds between retries + const ( + //nolint:revive + retryWaitMin = 2 * time.Second + retryWaitMax = 60 * time.Second + retryMax = 7 + ) + c.RetryWaitMin = retryWaitMin // Default is 1 second + c.RetryWaitMax = retryWaitMax // Default is 30 seconds + c.RetryMax = retryMax // Default is 4 retries (5 attempts in total) d.doer = c.StandardClient() // User settings