检查nodeid是否在线,默认将自己结点认为在线状态

This commit is contained in:
boyce
2019-04-22 16:09:53 +08:00
parent d15be63890
commit dc37d2ea8f

View File

@@ -317,6 +317,10 @@ func (slf *CCluster) GetNodeIdByServiceName(servicename string, bOnline bool) []
}
func (slf *CCluster) CheckNodeIsConnectedByID(nodeid int) bool {
if nodeid == GetNodeId() {
return true
}
pclient := slf.GetRpcClientByNodeId(nodeid)
if pclient == nil {
return false
@@ -326,6 +330,7 @@ func (slf *CCluster) CheckNodeIsConnectedByID(nodeid int) bool {
}
func (slf *CCluster) GetRpcClientByNodeId(nodeid int) *RpcClient {
pclient, ok := slf.nodeclient[nodeid]
if ok == false {
return nil