Merge pull request #2647 from seefs001/feature/status-code-auto-disable

feat: status code auto-disable configuration
This commit is contained in:
Seefs
2026-01-12 18:47:45 +08:00
committed by GitHub
parent 22b9438588
commit 41da848c56
13 changed files with 419 additions and 5 deletions

View File

@@ -57,9 +57,12 @@ func ShouldDisableChannel(channelType int, err *types.NewAPIError) bool {
if types.IsSkipRetryError(err) {
return false
}
if err.StatusCode == http.StatusUnauthorized {
if operation_setting.ShouldDisableByStatusCode(err.StatusCode) {
return true
}
//if err.StatusCode == http.StatusUnauthorized {
// return true
//}
if err.StatusCode == http.StatusForbidden {
switch channelType {
case constant.ChannelTypeGemini: