Merge pull request #23 from TwinProduction/max-idle-conns

Set MaxIdleConns and MaxIdleConnsPerHost to 100 and 20 respectively
This commit is contained in:
Chris C 2020-10-30 09:56:40 -04:00 committed by GitHub
commit 3df8fc8c3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,8 @@ func GetHTTPClient(insecure bool) *http.Client {
insecureHTTPClient = &http.Client{
Timeout: time.Second * 10,
Transport: &http.Transport{
MaxIdleConns: 100,
MaxIdleConnsPerHost: 20,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
@ -30,6 +32,10 @@ func GetHTTPClient(insecure bool) *http.Client {
if secureHTTPClient == nil {
secureHTTPClient = &http.Client{
Timeout: time.Second * 10,
Transport: &http.Transport{
MaxIdleConns: 100,
MaxIdleConnsPerHost: 20,
},
}
}
return secureHTTPClient