Micro improvements on connection handling.

This commit is contained in:
2023-12-13 22:44:57 +00:00
parent a107ee953b
commit 29afbd08fd
2 changed files with 12 additions and 4 deletions
+5 -1
View File
@@ -11,14 +11,18 @@ import (
func (b *BaseClient) createHttpClient() (http_client *http.Client) {
httpTransport := &http.Transport{
MaxIdleConns: 10,
MaxIdleConns: 512,
MaxConnsPerHost: 512,
MaxIdleConnsPerHost: 512,
IdleConnTimeout: 15 * time.Second,
ResponseHeaderTimeout: 15 * time.Second,
DisableKeepAlives: false,
DisableCompression: false,
}
if strings.HasPrefix(b.endpoint, "http://") {
http_client = &http.Client{
Timeout: 15 * time.Second,
Transport: httpTransport,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse