disabled channel when return 无可用渠道

This commit is contained in:
Ghostz
2024-06-21 11:40:36 +08:00
parent ff196b75a7
commit 15737cd0cf
2 changed files with 9 additions and 5 deletions

View File

@@ -1,10 +1,11 @@
package monitor
import (
"github.com/songquanpeng/one-api/common/config"
"github.com/songquanpeng/one-api/relay/model"
"net/http"
"strings"
"github.com/songquanpeng/one-api/common/config"
"github.com/songquanpeng/one-api/relay/model"
)
func ShouldDisableChannel(err *model.Error, statusCode int) bool {
@@ -35,6 +36,8 @@ func ShouldDisableChannel(err *model.Error, statusCode int) bool {
return true
} else if strings.HasPrefix(err.Message, "This organization has been disabled.") {
return true
} else if strings.HasPrefix(err.Message, "无可用渠道") {
return true
}
//if strings.Contains(err.Message, "quota") {
// return true