v1.5.1 增强程序稳定性
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user