增加动态调用rpc并增加rpc调用超时时间

This commit is contained in:
boyce
2019-05-15 14:09:47 +08:00
parent e5c92f981d
commit 67d3eec964
2 changed files with 10 additions and 1 deletions

View File

@@ -500,7 +500,7 @@ func GetNodeName(nodeid int) string {
}
func DynamicCall(address string, serviceMethod string, args interface{}, reply interface{}) error {
rpcClient, err := rpc.Dial("tcp", address)
rpcClient, err := rpc.DialTimeOut("tcp", address, time.Second*1)
if err != nil {
return err
}