Просмотр исходного кода

Fix: add http timeout & disable keep-alive

kr328 4 лет назад
Родитель
Сommit
8375fbd8b3
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      core/src/main/golang/config/fetch.go

+ 2 - 3
core/src/main/golang/config/fetch.go

@@ -25,13 +25,12 @@ type Status struct {
 
 var client = &http.Client{
 	Transport: &http.Transport{
-		// from http.DefaultTransport
-		MaxIdleConns:          100,
-		IdleConnTimeout:       90 * time.Second,
+		DisableKeepAlives:     true,
 		TLSHandshakeTimeout:   10 * time.Second,
 		ExpectContinueTimeout: 1 * time.Second,
 		DialContext:           dialer.DefaultTunnelDialer,
 	},
+	Timeout: 60 * time.Second,
 }
 
 func openUrl(url string) (io.ReadCloser, error) {