fix(observability): 治理SSE慢请求虚报、客户端取消日志污染、退款重试刷屏与会话计数慢查询
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
@@ -10,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func writeChatError(c *gin.Context, err error) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(c.Request.Context().Err(), context.Canceled) {
|
||||
return
|
||||
}
|
||||
response.RecordError(c, err)
|
||||
switch {
|
||||
case errors.Is(err, ErrDependencyUnavailable):
|
||||
|
||||
Reference in New Issue
Block a user