优化rpc调用错误日志

限制配置的服务必需安装
优化结点断开连接时删除结点
This commit is contained in:
duanhf2012
2023-03-17 12:09:00 +08:00
parent f9738fb9d0
commit f3ff09b90f
3 changed files with 28 additions and 2 deletions

View File

@@ -496,7 +496,11 @@ func (handler *RpcHandler) asyncCallRpc(nodeId int, serviceMethod string, args i
err, count := handler.funcRpcClient(nodeId, serviceMethod, pClientList[:])
if count == 0 || err != nil {
if err == nil {
err = fmt.Errorf("cannot find %s from nodeId %d",serviceMethod,nodeId)
if nodeId > 0 {
err = fmt.Errorf("cannot find %s from nodeId %d",serviceMethod,nodeId)
}else {
err = fmt.Errorf("No %s service found in the origin network",serviceMethod)
}
}
fVal.Call([]reflect.Value{reflect.ValueOf(reply), reflect.ValueOf(err)})
log.SError("Call serviceMethod is error:", err.Error())