From 54678cbf23f10ba0230a7541da2cbde7d87d3593 Mon Sep 17 00:00:00 2001 From: Zodial Date: Tue, 14 May 2024 17:15:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=80=E5=90=AF=E4=BB=85=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E9=94=99=E8=AF=AF=E6=97=B6=EF=BC=8C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E4=B8=AA=E9=94=99=E8=AF=AF=E5=90=8E=E5=B0=B1?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E8=AE=B0=E5=BD=95=E6=89=80=E6=9C=89=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/middleware.go b/middleware.go index 60daad3..fde393d 100644 --- a/middleware.go +++ b/middleware.go @@ -25,6 +25,9 @@ func Telescope() gin.HandlerFunc { } if errorRecord && hasError { log.WithContext(ctx).WithFields(log.Fields{"type": "request"}).Error(ctx.Request.URL) + defer func() { + hasError = false + }() } else { log.WithContext(ctx).WithFields(log.Fields{"type": "request"}).Debug(ctx.Request.URL) }