We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a18736a commit 8da84dfCopy full SHA for 8da84df
api/copilot/copilot.go
@@ -57,6 +57,15 @@ func (co *CopilotApi) TokenHandler(c *gin.Context) {
57
return
58
}
59
60
+ day := time.Now().Format("2006-01-02")
61
+ if dayCount, ok := AuthCount[day]; ok {
62
+ if authCount, ok := dayCount[TypeAuthToken]; ok && authCount > 200 {
63
+ global.SugarLog.Errorw("TokenHandler get auth token err, authorization limit > 200")
64
+ response.FailWithOpenAIError(http.StatusUnauthorized, "exceeded authorization limit", c)
65
+ return
66
+ }
67
68
+
69
tokenRawCache, err := GetTokenRawInfoCache(token)
70
if err == nil && len(tokenRawCache) > 0 {
71
global.SugarLog.Infow("TokenHandler get token raw cache", "token", token)
0 commit comments