diff options
author | Mateusz Nowotynski <maxmati4@gmail.com> | 2019-11-21 18:45:16 +0300 |
---|---|---|
committer | Paul Okstad <pokstad@gitlab.com> | 2019-11-21 18:45:16 +0300 |
commit | 19aee4fd5d0cf215b25456d0781b9fd1975d25f1 (patch) | |
tree | c3ca108afacd261b2361d8fc6ac86d4f29489233 /client | |
parent | 191728b0f695b1eb4cb2db8f30ef6b5439b2d6fa (diff) |
Replace depracated grpc.WithDialer
Signed-off-by: Mateusz Nowotyński <maxmati4@gmail.com>
Diffstat (limited to 'client')
-rw-r--r-- | client/dial.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/dial.go b/client/dial.go index 8ab04e788..befd73942 100644 --- a/client/dial.go +++ b/client/dial.go @@ -1,6 +1,7 @@ package client import ( + "context" "fmt" "net" "time" @@ -63,13 +64,14 @@ func Dial(rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, erro // Use a custom dialer to ensure that we don't experience // issues in environments that have proxy configurations // https://gitlab.com/gitlab-org/gitaly/merge_requests/1072#note_140408512 - grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) { + grpc.WithContextDialer(func(ctx context.Context, addr string) (conn net.Conn, err error) { path, err := extractPathFromSocketURL(addr) if err != nil { return nil, err } - return net.DialTimeout("unix", path, timeout) + d := net.Dialer{} + return d.DialContext(ctx, "unix", path) }), ) } |