This commit is contained in:
John Guo 2021-03-02 23:32:50 +08:00
commit 1c7f034135

View File

@ -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) sql, args = c.db.HandleSqlBeforeCommit(link, sql, args)
ctx := c.db.GetCtx() ctx := c.db.GetCtx()
if c.GetConfig().QueryTimeout > 0 { if c.GetConfig().QueryTimeout > 0 {
var cancelFunc context.CancelFunc ctx, _ = context.WithTimeout(ctx, c.GetConfig().QueryTimeout)
ctx, cancelFunc = context.WithTimeout(ctx, c.GetConfig().QueryTimeout)
defer cancelFunc()
} }
mTime1 := gtime.TimestampMilli() mTime1 := gtime.TimestampMilli()