fix: timeout on query should return context.DeadlineExceeded (#4060)

This commit is contained in:
Kevin Wan
2024-04-10 12:17:39 +08:00
committed by GitHub
parent d1f24ab70f
commit a66ae0d4c4
2 changed files with 20 additions and 1 deletions

View File

@@ -296,7 +296,7 @@ func (db *commonSqlConn) queryRows(ctx context.Context, scanner func(*sql.Rows)
return query(ctx, conn, func(rows *sql.Rows) error {
e := scanner(rows)
if e != nil {
if e != nil && !errors.Is(e, context.DeadlineExceeded) {
scanFailed = true
}
return e