新增私有结点功能

This commit is contained in:
boyce
2020-11-05 09:42:45 +08:00
parent e91dccca7d
commit 12cd732a4a
2 changed files with 6 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ var configDir = "./config/"
type NodeInfo struct {
NodeId int
NodeName string
Private bool
ListenAddr string
ServiceList []string
}
@@ -81,7 +82,7 @@ func (cls *Cluster) delServiceNode(serviceName string,nodeId int){
}
func (cls *Cluster) serviceDiscoverySetNodeInfo (nodeInfo *NodeInfo){
if nodeInfo.NodeId == cls.localNodeInfo.NodeId {
if nodeInfo.NodeId == cls.localNodeInfo.NodeId || len(nodeInfo.ServiceList)==0 || nodeInfo.Private == true {
return
}