优化节点连接管理逻辑与日志输出,修改连接错误处理函数的返回值以确保错误处理灵活性
This commit is contained in:
@@ -210,14 +210,15 @@ func startTask(ctx context.Context) error {
|
||||
if len(updates) == 0 {
|
||||
continue
|
||||
}
|
||||
err := app.Update(updates)
|
||||
lock.Lock()
|
||||
clear(updates)
|
||||
updates = updates[:0]
|
||||
lock.Unlock()
|
||||
err := app.Update(updates)
|
||||
if err != nil {
|
||||
slog.Error("调度更新任务失败", "err", err)
|
||||
} else {
|
||||
clear(updates)
|
||||
updates = updates[:0]
|
||||
}
|
||||
lock.Unlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user