From e434bb15bc323dbb32c4488445320c04fb2dc65c Mon Sep 17 00:00:00 2001 From: p4u Date: Tue, 27 Aug 2024 12:20:31 +0200 Subject: [PATCH] increase apiclient HTTP timeout and buffers Signed-off-by: p4u --- apiclient/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apiclient/client.go b/apiclient/client.go index 4db28487..fe375a8e 100644 --- a/apiclient/client.go +++ b/apiclient/client.go @@ -40,13 +40,13 @@ type HTTPclient struct { // NewHTTPclient creates a new HTTP(s) API Census3 client. func NewHTTPclient(addr *url.URL, bearerToken *uuid.UUID) (*HTTPclient, error) { tr := &http.Transport{ - IdleConnTimeout: 10 * time.Second, + IdleConnTimeout: 60 * time.Second, DisableCompression: false, - WriteBufferSize: 1 * 1024 * 1024, // 1 MiB - ReadBufferSize: 1 * 1024 * 1024, // 1 MiB + WriteBufferSize: 5 * 1024 * 1024, // 1 MiB + ReadBufferSize: 5 * 1024 * 1024, // 1 MiB } c := &HTTPclient{ - c: &http.Client{Transport: tr, Timeout: time.Second * 8}, + c: &http.Client{Transport: tr, Timeout: time.Second * 120}, token: bearerToken, addr: addr, }