From dde741cc9306efec181ac0275b4eaee66488cee8 Mon Sep 17 00:00:00 2001 From: Dmitry Onishchenko Date: Mon, 23 Sep 2019 13:58:33 +0200 Subject: [PATCH] Retry on 5xx errors only --- client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 3ff47b3..48224aa 100644 --- a/client/client.go +++ b/client/client.go @@ -153,7 +153,7 @@ func NewRestClient(url string, token string, version string, isVerbose bool, cer SetRetryMaxWaitTime(retryMaxWaitTime). AddRetryCondition( func(r *resty.Response) (bool, error) { - return r.StatusCode() >= http.StatusBadRequest, nil + return r.StatusCode() >= http.StatusInternalServerError, nil }, ) // default timeout of golang is very long