From d6c4d5f87f8356f10adc06737a62a5c92018e8a7 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:37:17 +0530 Subject: [PATCH] [cli] Fix: retry download on 500 --- cli/internal/api/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/internal/api/client.go b/cli/internal/api/client.go index b2f1645899..1127e6c2c2 100644 --- a/cli/internal/api/client.go +++ b/cli/internal/api/client.go @@ -74,7 +74,7 @@ func NewClient(p Params) *Client { SetRetryWaitTime(5 * time.Second). SetRetryMaxWaitTime(10 * time.Second). AddRetryCondition(func(r *resty.Response, err error) bool { - shouldRetry := r.StatusCode() == 429 || r.StatusCode() > 500 + shouldRetry := r.StatusCode() == 429 || r.StatusCode() >= 500 if shouldRetry { log.Printf("retrying download due to %d code", r.StatusCode()) }