v1.5.1 增强程序稳定性

This commit is contained in:
robin
2026-03-22 17:37:40 +08:00
parent afbaaa869c
commit 17e182b413
652 changed files with 22949 additions and 34397 deletions

View File

@@ -6,6 +6,7 @@ import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
"github.com/TeaOSLab/EdgeCommon/pkg/dnsconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
@@ -87,8 +88,8 @@ func (this *NodeConfigManager) Loop() error {
if err != nil {
return err
}
sharedNodeConfig = config
configs.SharedNodeConfig = config
sharedNodeConfig.Store(config)
configs.SharedNodeConfig.Store(config)
this.reload(config)
@@ -180,6 +181,12 @@ func (this *NodeConfigManager) changeAPINodeAddrs(apiNodeAddrs []*serverconfigs.
// 异步检测,防止阻塞
go func(v int64) {
defer func() {
if r := recover(); r != nil {
remotelogs.Error("NODE", fmt.Sprintf("goroutine panic: %v", r))
}
}()
// 测试新的API节点地址
if rpcClient.TestEndpoints(addrs) {
config.RPCEndpoints = addrs