Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMateusz Nowotynski <maxmati4@gmail.com>2019-11-21 18:45:16 +0300
committerPaul Okstad <pokstad@gitlab.com>2019-11-21 18:45:16 +0300
commit19aee4fd5d0cf215b25456d0781b9fd1975d25f1 (patch)
treec3ca108afacd261b2361d8fc6ac86d4f29489233 /client
parent191728b0f695b1eb4cb2db8f30ef6b5439b2d6fa (diff)
Replace depracated grpc.WithDialer
Signed-off-by: Mateusz Nowotyński <maxmati4@gmail.com>
Diffstat (limited to 'client')
-rw-r--r--client/dial.go6
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)
}),
)
}