From ea98dba8701ecf2945e840d061599175ca63f23e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 11 Nov 2020 16:52:00 +0300 Subject: [PATCH] fix: bump timeout for config downloading on bare metal Depending on the nature of the error, each attempt might take much longer than 1 second, so bump the overall timeout, but print the error encountered so that longer timeout doesn't mean less feedback for the user. Signed-off-by: Andrey Smirnov --- pkg/download/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/download/download.go b/pkg/download/download.go index 1c6517745..147e20af8 100644 --- a/pkg/download/download.go +++ b/pkg/download/download.go @@ -82,7 +82,7 @@ func Download(ctx context.Context, endpoint string, opts ...Option) (b []byte, e req.Header.Set(k, v) } - err = retry.Exponential(60*time.Second, retry.WithUnits(time.Second), retry.WithJitter(time.Second)).Retry(func() error { + err = retry.Exponential(180*time.Second, retry.WithUnits(time.Second), retry.WithJitter(time.Second), retry.WithErrorLogging(true)).Retry(func() error { select { case <-ctx.Done(): return retry.UnexpectedError(context.Canceled)