优化服务发现

This commit is contained in:
boyce
2021-05-06 16:09:27 +08:00
parent 1007845e95
commit bbab004f65
5 changed files with 10 additions and 9 deletions

View File

@@ -175,6 +175,7 @@ func (cls *Cluster) serviceDiscoverySetNodeInfo (nodeInfo *NodeInfo){
}
cls.mapIdNode[nodeInfo.NodeId] = *nodeInfo
log.Debug("Discovery nodeId: %d discovery service:%+v",nodeInfo.NodeId,nodeInfo.PublicServiceList)
//已经存在连接,则不需要进行设置
if _,rpcInfoOK := cls.mapRpc[nodeInfo.NodeId];rpcInfoOK == true {
return
@@ -186,9 +187,7 @@ func (cls *Cluster) serviceDiscoverySetNodeInfo (nodeInfo *NodeInfo){
rpcInfo.client.Connect(nodeInfo.NodeId,nodeInfo.ListenAddr)
cls.mapRpc[nodeInfo.NodeId] = rpcInfo
//debug
fmt.Printf("xxxxxxxxxxxx")
fmt.Println(nodeInfo)
}
func (cls *Cluster) buildLocalRpc(){