mirror of
https://github.com/linux-do/new-api.git
synced 2025-12-26 00:25:57 +08:00
fix: disable channel when 401 received (close #467)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user