优化RPC连接

This commit is contained in:
刘祥超
2021-11-10 22:22:27 +08:00
parent e9a3ed71b4
commit 1d9460f565
7 changed files with 58 additions and 10 deletions

View File

@@ -91,10 +91,15 @@ func (this *ValidateApiAction) RunPost(params struct {
},
NodeId: params.OldNodeId,
Secret: params.OldNodeSecret,
})
}, false)
if err != nil {
this.FailField("oldHost", "测试API节点时出错请检查配置错误信息"+err.Error())
}
defer func() {
_ = client.Close()
}()
_, err = client.APINodeRPC().FindCurrentAPINodeVersion(client.APIContext(0), &pb.FindCurrentAPINodeVersionRequest{})
if err != nil {
this.FailField("oldHost", "无法连接此API节点错误信息"+err.Error())