fix: fix ignored context.DeadlineExceeded (#4066)

This commit is contained in:
Kevin Wan
2024-04-11 11:14:20 +08:00
committed by GitHub
parent 2a7ada993b
commit 927f8bc821
4 changed files with 7 additions and 3 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 && !errors.Is(e, context.DeadlineExceeded) {
if isScanFailed(e) {
scanFailed = true
}
return e