From ebf4b05bfe6be1b480b86ed45a0c14ee2d00358d Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 4 Mar 2024 17:44:29 +0200 Subject: [PATCH] Increase max retry count and header timeout --- messagix/client.go | 2 +- messagix/http.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/messagix/client.go b/messagix/client.go index c71a08b..e7f4a40 100644 --- a/messagix/client.go +++ b/messagix/client.go @@ -92,7 +92,7 @@ func NewClient(cookies *cookies.Cookies, logger zerolog.Logger) *Client { Transport: &http.Transport{ DialContext: (&net.Dialer{Timeout: 10 * time.Second}).DialContext, TLSHandshakeTimeout: 10 * time.Second, - ResponseHeaderTimeout: 20 * time.Second, + ResponseHeaderTimeout: 40 * time.Second, ForceAttemptHTTP2: true, }, CheckRedirect: func(req *http.Request, via []*http.Request) error { diff --git a/messagix/http.go b/messagix/http.go index 1d634ce..6eb3378 100644 --- a/messagix/http.go +++ b/messagix/http.go @@ -77,7 +77,7 @@ func (c *Client) NewHttpQuery() *HttpQuery { return query } -const MaxHTTPRetries = 3 +const MaxHTTPRetries = 5 func (c *Client) MakeRequest(url string, method string, headers http.Header, payload []byte, contentType types.ContentType) (*http.Response, []byte, error) { var attempts int