ソースを参照

Fix: add http timeout & disable keep-alive

kr328 4 年 前
コミット
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) {