From d42ac347cfb8c618521ed3f4270d352fe54aec0a Mon Sep 17 00:00:00 2001 From: Ben Sarmiento Date: Fri, 26 Jan 2024 18:37:20 +0100 Subject: [PATCH] Remove deadline check --- pkg/http/client.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkg/http/client.go b/pkg/http/client.go index 4c6b576..e90513f 100644 --- a/pkg/http/client.go +++ b/pkg/http/client.go @@ -194,19 +194,7 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) { for { r.replaceHostIfNeeded(req) - ctx, cancel := context.WithTimeout(req.Context(), time.Duration(r.timeoutSecs)*time.Second) - defer cancel() - req = req.WithContext(ctx) - resp, err = r.client.Do(req) - select { - case <-ctx.Done(): - if ctx.Err() == context.DeadlineExceeded { - err = fmt.Errorf("request timed out after %d seconds", r.timeoutSecs) - } - default: - } - if resp != nil && (resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent) { body, _ := io.ReadAll(resp.Body) if body != nil {