1.优化CALL Rpc错误返回

2.优化不同邻居Master服务发现规则
This commit is contained in:
boyce
2021-05-07 17:47:49 +08:00
parent 212798dc04
commit 806e4040db
3 changed files with 40 additions and 12 deletions

View File

@@ -150,6 +150,7 @@ func (cls *Cluster) delServiceNode(serviceName string,nodeId int){
}
}
func (cls *Cluster) serviceDiscoverySetNodeInfo (nodeInfo *NodeInfo){
//本地结点不加入
if nodeInfo.NodeId == cls.localNodeInfo.NodeId {
@@ -272,6 +273,10 @@ func (cls *Cluster) GetMasterDiscoveryNodeInfo(nodeId int) *NodeInfo{
return nil
}
func (cls *Cluster) IsMasterDiscoveryNode() bool{
return cls.GetMasterDiscoveryNodeInfo(cls.GetLocalNodeInfo().NodeId)!=nil
}
func (cls *Cluster) SetupServiceDiscovery(localNodeId int,setupServiceFun SetupServiceFun) {
if cls.serviceDiscovery!=nil {
return