Skip to content

Commit 8bee10f

Browse files
authored
fix(clients): add a default idleConnTimeout (#5442)
1 parent b8b8629 commit 8bee10f

File tree

1 file changed

+2
-0
lines changed
  • clients/algoliasearch-client-go/algolia/transport

1 file changed

+2
-0
lines changed

clients/algoliasearch-client-go/algolia/transport/requester.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const (
1010
DefaultConnectTimeout = 2 * time.Second
1111
DefaultKeepAliveDuration = 5 * time.Minute
1212
DefaultMaxIdleConnsPerHost = 64
13+
DefaultMaxIdleTimeout = 45 * time.Second
1314
DefaultTLSHandshakeTimeout = 2 * time.Second
1415
)
1516

@@ -36,6 +37,7 @@ func DefaultHTTPClient(connectTimeout *time.Duration) *http.Client {
3637
}).DialContext,
3738
DisableKeepAlives: false,
3839
MaxIdleConnsPerHost: DefaultMaxIdleConnsPerHost,
40+
IdleConnTimeout: DefaultConnectTimeout,
3941
Proxy: http.ProxyFromEnvironment,
4042
TLSHandshakeTimeout: DefaultTLSHandshakeTimeout,
4143
},

0 commit comments

Comments
 (0)