diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-07-03 10:06:24 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-07-06 08:49:55 +0300 |
commit | 1f267efcf53c05582922b4b4ce83318456c0b181 (patch) | |
tree | 961b4baafc741f5665fea940788dba308c596bc5 /internal/praefect/metadata | |
parent | ddc9cc35ff76b776aa2a3a984db1341b36496501 (diff) |
hooks: Use new connection pool interface
Now that we've got a connection pooling interface available that manages
GRPC connections for us, let's use that one instead of custom-coding our
own.
Diffstat (limited to 'internal/praefect/metadata')
-rw-r--r-- | internal/praefect/metadata/server.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/internal/praefect/metadata/server.go b/internal/praefect/metadata/server.go index 1a19a1e6f..75d98d9f5 100644 --- a/internal/praefect/metadata/server.go +++ b/internal/praefect/metadata/server.go @@ -10,11 +10,8 @@ import ( "net/url" "strings" - gitalyauth "gitlab.com/gitlab-org/gitaly/auth" - "gitlab.com/gitlab-org/gitaly/client" "gitlab.com/gitlab-org/gitaly/internal/bootstrap/starter" "gitlab.com/gitlab-org/gitaly/internal/praefect/config" - "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" @@ -251,20 +248,3 @@ func (p *PraefectServer) Address() (string, error) { return "", errors.New("no address configured") } - -// Dial will try to connect to the given Praefect server -func (p *PraefectServer) Dial(ctx context.Context) (*grpc.ClientConn, error) { - opts := []grpc.DialOption{ - grpc.WithBlock(), - } - if p.Token != "" { - opts = append(opts, grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(p.Token))) - } - - address, err := p.Address() - if err != nil { - return nil, err - } - - return client.DialContext(ctx, address, opts) -} |