refactor: clean up unused imports and commented-out code in channel.go
This commit is contained in:
parent
3ab65a8221
commit
8c8661d0d7
@ -2,11 +2,9 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/QuantumNous/new-api/common"
|
"github.com/QuantumNous/new-api/common"
|
||||||
"github.com/QuantumNous/new-api/constant"
|
|
||||||
"github.com/QuantumNous/new-api/dto"
|
"github.com/QuantumNous/new-api/dto"
|
||||||
"github.com/QuantumNous/new-api/model"
|
"github.com/QuantumNous/new-api/model"
|
||||||
"github.com/QuantumNous/new-api/setting/operation_setting"
|
"github.com/QuantumNous/new-api/setting/operation_setting"
|
||||||
@ -63,12 +61,12 @@ func ShouldDisableChannel(channelType int, err *types.NewAPIError) bool {
|
|||||||
//if err.StatusCode == http.StatusUnauthorized {
|
//if err.StatusCode == http.StatusUnauthorized {
|
||||||
// return true
|
// return true
|
||||||
//}
|
//}
|
||||||
if err.StatusCode == http.StatusForbidden {
|
//if err.StatusCode == http.StatusForbidden {
|
||||||
switch channelType {
|
// switch channelType {
|
||||||
case constant.ChannelTypeGemini:
|
// case constant.ChannelTypeGemini:
|
||||||
return true
|
// return true
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
oaiErr := err.ToOpenAIError()
|
oaiErr := err.ToOpenAIError()
|
||||||
switch oaiErr.Code {
|
switch oaiErr.Code {
|
||||||
case "invalid_api_key":
|
case "invalid_api_key":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user