mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-19 18:16:38 +08:00
Merge pull request #34 from myronzhangweb3/fix-manage-channel
fix manage channel
This commit is contained in:
commit
6141d6e24c
@ -255,10 +255,10 @@ func testChannels(ctx context.Context, notify bool, scope string) error {
|
|||||||
_ = message.Notify(message.ByAll, fmt.Sprintf("Channel %s (%d)Test超时", channel.Name, channel.Id), "", err.Error())
|
_ = message.Notify(message.ByAll, fmt.Sprintf("Channel %s (%d)Test超时", channel.Name, channel.Id), "", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isChannelEnabled && monitor.ShouldDisableChannel(openaiErr, -1) {
|
if isChannelEnabled && (err != nil || monitor.ShouldDisableChannel(openaiErr, -1)) {
|
||||||
monitor.DisableChannel(channel.Id, channel.Name, err.Error())
|
monitor.DisableChannel(channel.Id, channel.Name, err.Error())
|
||||||
}
|
}
|
||||||
if !isChannelEnabled && monitor.ShouldEnableChannel(err, openaiErr) {
|
if !isChannelEnabled && (err == nil && monitor.ShouldEnableChannel(err, openaiErr)) {
|
||||||
monitor.EnableChannel(channel.Id, channel.Name)
|
monitor.EnableChannel(channel.Id, channel.Name)
|
||||||
}
|
}
|
||||||
channel.UpdateResponseTime(milliseconds)
|
channel.UpdateResponseTime(milliseconds)
|
||||||
|
Loading…
Reference in New Issue
Block a user