From 765e5f8b667503c974171634bcb340b158c8da70 Mon Sep 17 00:00:00 2001 From: ckt <65409152+ckt1031@users.noreply.github.com> Date: Sun, 22 Oct 2023 10:40:13 +0000 Subject: [PATCH] fix: issue --- controller/channel-test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controller/channel-test.go b/controller/channel-test.go index d8b0769a..3db2a24e 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -253,7 +253,7 @@ func testAllChannels(notify bool) error { } go func() { for _, channel := range channels { - if channel.Status != common.ChannelStatusEnabled { + if channel.Status != common.ChannelStatusEnabled || (channel.Status == common.ChannelStatusAutoDisabled && common.AutoReEnableFailedChannelEnabled) { continue } tik := time.Now() @@ -264,9 +264,11 @@ func testAllChannels(notify bool) error { if milliseconds > disableThreshold { err = errors.New(fmt.Sprintf("响应时间 %.2fs 超过阈值 %.2fs", float64(milliseconds)/1000.0, float64(disableThreshold)/1000.0)) disableChannel(channel.Id, channel.Name, err.Error()) - } else if shouldDisableChannel(openaiErr, -1) { + } + if shouldDisableChannel(openaiErr, -1) { disableChannel(channel.Id, channel.Name, err.Error()) - } else if channel.Status == common.ChannelStatusAutoDisabled && common.AutoReEnableFailedChannelEnabled { + } + if channel.Status == common.ChannelStatusAutoDisabled && common.AutoReEnableFailedChannelEnabled { enableChannel(channel.Id, channel.Name) } channel.UpdateResponseTime(milliseconds)