fix(observability): 治理SSE慢请求虚报、客户端取消日志污染、退款重试刷屏与会话计数慢查询

This commit is contained in:
yml2213
2026-09-10 20:02:54 +08:00
parent ee0e70ccad
commit 784ffb5f72
7 changed files with 24 additions and 8 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
package response
import (
"context"
"errors"
"fmt"
"net/http"
@@ -45,7 +46,7 @@ func Error(c *gin.Context, status int, code, message string) {
// RecordError 保存原始错误,供统一请求日志记录服务端故障原因。
func RecordError(c *gin.Context, err error) {
if c == nil || err == nil {
if c == nil || err == nil || errors.Is(err, context.Canceled) {
return
}
for _, item := range c.Errors {