From 8375fbd8b3d8874f94a04cbb1effab95ad3146d6 Mon Sep 17 00:00:00 2001
From: kr328 <kr328app@outlook.com>
Date: Sun, 13 Jun 2021 02:45:20 +0800
Subject: [PATCH] Fix: add http timeout & disable keep-alive

---
 core/src/main/golang/config/fetch.go | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/core/src/main/golang/config/fetch.go b/core/src/main/golang/config/fetch.go
index 941b39b0..281df3db 100644
--- a/core/src/main/golang/config/fetch.go
+++ b/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) {
-- 
GitLab