Skip to content

Commit

Permalink
pkg: disable reuse of tcp connection with same host
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavosbarreto committed Nov 4, 2022
1 parent cc6ef45 commit 73dbd27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ func NewClient(opts ...Opt) Client {
return r.StatusCode() >= http.StatusInternalServerError && r.StatusCode() != http.StatusNotImplemented
})

// disable reuse of TCP connection with same host
if transport, ok := httpClient.GetClient().Transport.(*http.Transport); ok {
transport.MaxIdleConnsPerHost = -1
}

c := &client{
host: apiHost,
port: apiPort,
Expand Down

0 comments on commit 73dbd27

Please sign in to comment.