From ad98aad2d26b7b30b87daea8bd8d49da63fcda24 Mon Sep 17 00:00:00 2001 From: Mmx <1624045573@qq.com> Date: Wed, 29 Sep 2021 17:47:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20timeout=E4=BB=85=E5=AF=B9checker?= =?UTF-8?q?=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/checker.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/checker.go b/util/checker.go index 9ccd125..d8417e4 100644 --- a/util/checker.go +++ b/util/checker.go @@ -1,6 +1,10 @@ package util -import "github.com/Mmx233/tool" +import ( + "autoLogin/global" + "github.com/Mmx233/tool" + "time" +) type checker struct{} @@ -10,6 +14,7 @@ func (checker) NetOk() bool { h, _, e := tool.HTTP.GetBytes(&tool.GetRequest{ Url: "https://www.baidu.com/", Redirect: false, + Timeout: time.Duration(global.Config.Settings.Timeout) * time.Second, }) if e != nil || h.Get("Location") != "" { return false