From f88e184d8c38d0434fb26f6915b4c2ee922582e1 Mon Sep 17 00:00:00 2001 From: WTIFS <9314475+WTIFS@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:44:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=9E=E6=8E=A5=E5=8C=97=E6=9E=81?= =?UTF-8?q?=E6=98=9F=E8=8E=B7=E5=8F=96=E8=87=AA=E8=BA=ABIP=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B6=85=E6=97=B6=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB=20(#200)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/config.go b/api/config.go index 66a52d09..743d9c54 100644 --- a/api/config.go +++ b/api/config.go @@ -334,7 +334,8 @@ func initSelfIP(cfg config.Configuration) { return } - conn, _ := net.Dial("tcp", address[0]) + timeout := cfg.GetGlobal().GetServerConnector().GetConnectTimeout() + conn, _ := net.DialTimeout("tcp", address[0], timeout) if conn != nil { localAddr := conn.LocalAddr().String() colonIdx := strings.LastIndex(localAddr, ":")