补充新增GetNodeInfo接口

This commit is contained in:
duanhf2012
2023-11-15 08:48:41 +08:00
parent 39b862e3d9
commit 43122190a3

View File

@@ -477,3 +477,14 @@ func (cls *Cluster) GetGlobalCfg() interface{} {
return cls.globalCfg
}
func (cls *Cluster) GetNodeInfo(nodeId int) (NodeInfo,bool) {
cls.locker.RLock()
defer cls.locker.RUnlock()
nodeInfo,ok:= cls.mapRpc[nodeId]
if ok == false || nodeInfo == nil {
return NodeInfo{},false
}
return nodeInfo.nodeInfo,true
}