Skip to content

Commit

Permalink
increase apiclient HTTP timeout and buffers
Browse files Browse the repository at this point in the history
Signed-off-by: p4u <pau@dabax.net>
  • Loading branch information
p4u committed Aug 27, 2024
1 parent 95b322d commit e434bb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apiclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit e434bb1

Please sign in to comment.