feat: 渠道新可选是否自动禁用功能

This commit is contained in:
CaIon
2023-09-25 18:44:10 +08:00
parent 3d55548c92
commit 80271b33ba
6 changed files with 45 additions and 4 deletions

View File

@@ -128,7 +128,7 @@ func shouldDisableChannel(err *OpenAIError, statusCode int) bool {
if err == nil {
return false
}
if statusCode == http.StatusUnauthorized {
if statusCode == http.StatusUnauthorized || statusCode == http.StatusTooManyRequests {
return true
}
if err.Type == "insufficient_quota" || err.Code == "invalid_api_key" || err.Code == "account_deactivated" {