diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2019-01-12 17:25:16 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-12 17:25:16 -0800 |
| commit | fc3c38d0b8663c73524e1c2070fc29241f62b38e (patch) | |
| tree | b86669032b2e1d5cf1e5e225296849488a663d5d /weed/util/grpc_client_server.go | |
| parent | 8613e4f55826a2d12cf1559f643a6c68c872a11b (diff) | |
| parent | 80cf99db1b4ba9cb74b68523129d786b7ed85da3 (diff) | |
| download | seaweedfs-fc3c38d0b8663c73524e1c2070fc29241f62b38e.tar.xz seaweedfs-fc3c38d0b8663c73524e1c2070fc29241f62b38e.zip | |
Merge pull request #831 from PapaYofen/fix-823
Set rpc dial timeout to 5s
Diffstat (limited to 'weed/util/grpc_client_server.go')
| -rw-r--r-- | weed/util/grpc_client_server.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/util/grpc_client_server.go b/weed/util/grpc_client_server.go index 18d5c02c9..d487e8bb4 100644 --- a/weed/util/grpc_client_server.go +++ b/weed/util/grpc_client_server.go @@ -25,7 +25,8 @@ func NewGrpcServer() *grpc.Server { } func GrpcDial(address string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { - + opts = append(opts, grpc.WithBlock()) + opts = append(opts, grpc.WithTimeout(time.Duration(5*time.Second))) opts = append(opts, grpc.WithInsecure()) opts = append(opts, grpc.WithKeepaliveParams(keepalive.ClientParameters{ Time: 30 * time.Second, // client ping server if no activity for this long |
