From 856d3e1617290f553d1c70d69c6fbc1883726528 Mon Sep 17 00:00:00 2001 From: kelvin Date: Wed, 10 May 2023 19:25:30 +0800 Subject: [PATCH] =?UTF-8?q?500=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 5 ----- service.go | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index e4a2096..12407ad 100644 --- a/main.go +++ b/main.go @@ -467,11 +467,6 @@ func checkKeyMid() gin.HandlerFunc { } // 执行函数 c.Next() - var a = c.Writer.Header().Get("Openai-Organization") - if a != "" { - c.Writer.Header().Set("Openai-Organization", "12321321") - } - } } diff --git a/service.go b/service.go index 90d8832..d0253be 100644 --- a/service.go +++ b/service.go @@ -25,11 +25,13 @@ func checkKeyAndTimeCount(key string) (int, error) { } count, err := Redis.Incr(context.Background(), "user:count:"+key).Result() if err != nil { + log.Printf("系统计数器设置异常 %s", err.Error()) return 500, errors.New("系统计数器设置异常") } if count == 1 { _, err := Redis.Expire(context.Background(), "user:count:"+key, timeOut).Result() if err != nil { + log.Printf("系统计数器异常 %s", err.Error()) return 500, errors.New("系统计数器异常") } }