Browse Source

优化http client

lijian 4 years ago
parent
commit
a75e26617f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      pkg/utils/http_client.go

+ 5 - 0
pkg/utils/http_client.go

@@ -317,6 +317,11 @@ func NewHttpClient() *HttpClient {
 	return &HttpClient{
 		httpClient: &http.Client{
 			Timeout: defaultRequestTimeout,
+			Transport: &http.Transport{
+				MaxIdleConns:           0,
+				MaxIdleConnsPerHost:    0,
+				MaxConnsPerHost:        0,
+			},
 		},
 		retryWaitTime: defaultRetryWaitTime,
 		retryCount:    defaultRetryCount,