fix: disable channel when 401 received (close #467)

This commit is contained in:
JustSong
2023-08-26 12:05:18 +08:00
parent efeb9a16ce
commit ac7c0f3a76
3 changed files with 7 additions and 3 deletions

View File

@@ -174,7 +174,7 @@ func testAllChannels(notify bool) error {
err = errors.New(fmt.Sprintf("响应时间 %.2fs 超过阈值 %.2fs", float64(milliseconds)/1000.0, float64(disableThreshold)/1000.0))
disableChannel(channel.Id, channel.Name, err.Error())
}
if shouldDisableChannel(openaiErr) {
if shouldDisableChannel(openaiErr, -1) {
disableChannel(channel.Id, channel.Name, err.Error())
}
channel.UpdateResponseTime(milliseconds)