From 0e6cddb54775866769c6bda6a15e5cb8afb7d7f0 Mon Sep 17 00:00:00 2001 From: turc Date: Mon, 1 Mar 2021 01:43:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4cancelFunc=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E9=80=80=E5=87=BA=E4=B9=8B=E5=89=8D=E5=85=B3=E9=97=ADmysqlConn?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database/gdb/gdb_core.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/database/gdb/gdb_core.go b/database/gdb/gdb_core.go index d26606226..7f2a6a1b5 100644 --- a/database/gdb/gdb_core.go +++ b/database/gdb/gdb_core.go @@ -111,9 +111,7 @@ func (c *Core) DoQuery(link Link, sql string, args ...interface{}) (rows *sql.Ro sql, args = c.db.HandleSqlBeforeCommit(link, sql, args) ctx := c.db.GetCtx() if c.GetConfig().QueryTimeout > 0 { - var cancelFunc context.CancelFunc - ctx, cancelFunc = context.WithTimeout(ctx, c.GetConfig().QueryTimeout) - defer cancelFunc() + ctx, _ = context.WithTimeout(ctx, c.GetConfig().QueryTimeout) } mTime1 := gtime.TimestampMilli()