From c7624c3015fd54dee20d01392d8de58bca33f157 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Thu, 25 Mar 2021 09:44:52 +0800 Subject: [PATCH] increase timout to 60s when connecting to tidb database --- pkg/tidb/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tidb/client.go b/pkg/tidb/client.go index 4e585e2087..e349967385 100644 --- a/pkg/tidb/client.go +++ b/pkg/tidb/client.go @@ -120,7 +120,7 @@ func (c *Client) OpenSQLConn(user string, pass string) (*gorm.DB, error) { dsnConfig.Addr = addr dsnConfig.User = user dsnConfig.Passwd = pass - dsnConfig.Timeout = time.Second + dsnConfig.Timeout = time.Second * 60 dsnConfig.ParseTime = true dsnConfig.Loc = time.Local dsnConfig.MultiStatements = true