This commit is contained in:
GoEdgeLab
2022-06-22 14:00:56 +08:00
parent a8cc2246b3
commit 0847199351

View File

@@ -1077,7 +1077,7 @@ func (this *NodeDAO) ComposeNodeConfig(tx *dbs.Tx, nodeId int64, cacheMap *utils
// 最大线程数、TCP连接数 // 最大线程数、TCP连接数
if clusterIndex == 0 { if clusterIndex == 0 {
config.MaxThreads = int(nodeCluster.NodeMaxThreads) config.MaxThreads = int(nodeCluster.NodeMaxThreads)
config.DDOSProtection = nodeCluster.DecodeDDoSProtection() config.DDoSProtection = nodeCluster.DecodeDDoSProtection()
config.AutoOpenPorts = nodeCluster.AutoOpenPorts == 1 config.AutoOpenPorts = nodeCluster.AutoOpenPorts == 1
} }
@@ -1212,10 +1212,10 @@ func (this *NodeDAO) ComposeNodeConfig(tx *dbs.Tx, nodeId int64, cacheMap *utils
// DDOS Protection // DDOS Protection
var ddosProtection = node.DecodeDDoSProtection() var ddosProtection = node.DecodeDDoSProtection()
if ddosProtection != nil { if ddosProtection != nil {
if config.DDOSProtection == nil { if config.DDoSProtection == nil {
config.DDOSProtection = ddosProtection config.DDoSProtection = ddosProtection
} else { } else {
config.DDOSProtection.Merge(ddosProtection) config.DDoSProtection.Merge(ddosProtection)
} }
} }