🔖 chore: Remove unnecessary print statements
This commit is contained in:
parent
bb7e0ae80f
commit
8fc2f1a4a3
@ -111,7 +111,6 @@ func dingtalkErrFunc(resp *http.Response) *types.OpenAIError {
|
|||||||
|
|
||||||
err := json.NewDecoder(resp.Body).Decode(respMsg)
|
err := json.NewDecoder(resp.Body).Decode(respMsg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,6 @@ func getLarkUserInfoByCode(code string) (*LarkUser, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
fmt.Println("larkUser", larkUser)
|
|
||||||
return &larkUser, nil
|
return &larkUser, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package middleware
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"one-api/common"
|
"one-api/common"
|
||||||
"time"
|
"time"
|
||||||
@ -39,7 +38,6 @@ func redisRateLimiter(c *gin.Context, maxRequestNum int, duration int64, mark st
|
|||||||
key := "rateLimit:" + mark + c.ClientIP()
|
key := "rateLimit:" + mark + c.ClientIP()
|
||||||
listLength, err := rdb.LLen(ctx, key).Result()
|
listLength, err := rdb.LLen(ctx, key).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err.Error())
|
|
||||||
c.Status(http.StatusInternalServerError)
|
c.Status(http.StatusInternalServerError)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
@ -51,7 +49,6 @@ func redisRateLimiter(c *gin.Context, maxRequestNum int, duration int64, mark st
|
|||||||
oldTimeStr, _ := rdb.LIndex(ctx, key, -1).Result()
|
oldTimeStr, _ := rdb.LIndex(ctx, key, -1).Result()
|
||||||
oldTime, err := time.Parse(timeFormat, oldTimeStr)
|
oldTime, err := time.Parse(timeFormat, oldTimeStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
|
||||||
c.Status(http.StatusInternalServerError)
|
c.Status(http.StatusInternalServerError)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
@ -59,7 +56,6 @@ func redisRateLimiter(c *gin.Context, maxRequestNum int, duration int64, mark st
|
|||||||
nowTimeStr := time.Now().Format(timeFormat)
|
nowTimeStr := time.Now().Format(timeFormat)
|
||||||
nowTime, err := time.Parse(timeFormat, nowTimeStr)
|
nowTime, err := time.Parse(timeFormat, nowTimeStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
|
||||||
c.Status(http.StatusInternalServerError)
|
c.Status(http.StatusInternalServerError)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user