From 51be7f2882d41acf8cfc68a793d6c5ebe1fbf776 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Fri, 17 Nov 2023 16:22:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B6=85=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=A6=81=E7=94=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/channel-test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controller/channel-test.go b/controller/channel-test.go index f3850f5..18f1e9b 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -180,11 +180,12 @@ func testAllChannels(notify bool) error { err, openaiErr := testChannel(channel, *testRequest) tok := time.Now() milliseconds := tok.Sub(tik).Milliseconds() + + ban := false 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()) + ban = true } - ban := true // parse *int to bool if channel.AutoBan != nil && *channel.AutoBan == 0 { ban = false