fix(observability): 治理SSE慢请求虚报、客户端取消日志污染、退款重试刷屏与会话计数慢查询
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user