Skip to content

Commit

Permalink
Merge branch 'main' into latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcium-Ion committed Nov 17, 2023
2 parents 0bb3404 + 51be7f2 commit fc49441
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controller/channel-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc49441

Please sign in to comment.