mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-27 04:16:37 +08:00
fix: test all channel
This commit is contained in:
parent
c6ba325a1d
commit
64f9e5f560
@ -219,13 +219,15 @@ func testAllChannels(notify bool) error {
|
|||||||
if channel.AutoBan != nil && *channel.AutoBan == 0 {
|
if channel.AutoBan != nil && *channel.AutoBan == 0 {
|
||||||
ban = false
|
ban = false
|
||||||
}
|
}
|
||||||
openAiErrWithStatus := dto.OpenAIErrorWithStatusCode{
|
if openaiErr != nil && isChannelEnabled && ban {
|
||||||
StatusCode: -1,
|
openAiErrWithStatus := dto.OpenAIErrorWithStatusCode{
|
||||||
Error: *openaiErr,
|
StatusCode: -1,
|
||||||
LocalError: false,
|
Error: *openaiErr,
|
||||||
}
|
LocalError: false,
|
||||||
if isChannelEnabled && service.ShouldDisableChannel(&openAiErrWithStatus) && ban {
|
}
|
||||||
service.DisableChannel(channel.Id, channel.Name, err.Error())
|
if service.ShouldDisableChannel(&openAiErrWithStatus) {
|
||||||
|
service.DisableChannel(channel.Id, channel.Name, err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if !isChannelEnabled && service.ShouldEnableChannel(err, openaiErr, channel.Status) {
|
if !isChannelEnabled && service.ShouldEnableChannel(err, openaiErr, channel.Status) {
|
||||||
service.EnableChannel(channel.Id, channel.Name)
|
service.EnableChannel(channel.Id, channel.Name)
|
||||||
|
Loading…
Reference in New Issue
Block a user