mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-05 22:03:42 +08:00
fix testAllChannels nil pointer panic
This commit is contained in:
@@ -222,6 +222,7 @@ func testAllChannels(notify bool) error {
|
||||
if channel.AutoBan != nil && *channel.AutoBan == 0 {
|
||||
ban = false
|
||||
}
|
||||
if openaiErr != nil {
|
||||
openAiErrWithStatus := dto.OpenAIErrorWithStatusCode{
|
||||
StatusCode: -1,
|
||||
Error: *openaiErr,
|
||||
@@ -233,6 +234,7 @@ func testAllChannels(notify bool) error {
|
||||
if !isChannelEnabled && service.ShouldEnableChannel(err, openaiErr, channel.Status) {
|
||||
service.EnableChannel(channel.Id, channel.Name)
|
||||
}
|
||||
}
|
||||
channel.UpdateResponseTime(milliseconds)
|
||||
time.Sleep(common.RequestInterval)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user