cmd/dist: add global connect-timeout for GRPC

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2017-02-28 16:43:08 -08:00
parent 317b884110
commit d61d0b5aef
No known key found for this signature in database
GPG key ID: 67B3DED84EDC823F
3 changed files with 9 additions and 4 deletions

2
cmd/dist/common.go vendored
View file

@ -24,7 +24,9 @@ func resolveContentStore(context *cli.Context) (*content.Store, error) {
func connectGRPC(context *cli.Context) (*grpc.ClientConn, error) {
socket := context.GlobalString("socket")
timeout := context.GlobalDuration("connect-timeout")
return grpc.Dial(socket,
grpc.WithTimeout(timeout),
grpc.WithBlock(),
grpc.WithInsecure(),
grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {