mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-21 18:56:38 +08:00
auto remove API KEYS that execeed quota
This commit is contained in:
parent
01d8a5b77d
commit
361c157e06
@ -172,7 +172,9 @@ func (s *Server) sendMessage(session types.ChatSession, role types.ChatRole, pro
|
|||||||
}
|
}
|
||||||
if len(line) < 20 {
|
if len(line) < 20 {
|
||||||
continue
|
continue
|
||||||
} else if strings.Contains(line, "This key is associated with a deactivated account") {
|
} else if strings.Contains(line, "This key is associated with a deactivated account") || // 账号被禁用
|
||||||
|
strings.Contains(line, "You exceeded your current quota") { // 当前 KEY 余额被用尽
|
||||||
|
|
||||||
logger.Infof("API Key %s is deactivated", apiKey)
|
logger.Infof("API Key %s is deactivated", apiKey)
|
||||||
// 移除当前 API key
|
// 移除当前 API key
|
||||||
for i, v := range s.Config.Chat.ApiKeys {
|
for i, v := range s.Config.Chat.ApiKeys {
|
||||||
|
Loading…
Reference in New Issue
Block a user