From a7040647a4c92a02a8e338d6cec74cb8d691acb2 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2019 15:19:13 -0700 Subject: [PATCH] run certificate authorization endpoint (#3108) --- pkg/certificate/peer.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/certificate/peer.go b/pkg/certificate/peer.go index e131fab57..2026faf8e 100644 --- a/pkg/certificate/peer.go +++ b/pkg/certificate/peer.go @@ -9,6 +9,7 @@ import ( "github.com/zeebo/errs" "go.uber.org/zap" + "golang.org/x/sync/errgroup" "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/internal/errs2" @@ -104,7 +105,17 @@ func New(log *zap.Logger, ident *identity.FullIdentity, ca *identity.FullCertifi func (peer *Peer) Run(ctx context.Context) (err error) { defer mon.Task()(&ctx)(&err) - return errs2.IgnoreCanceled(peer.Server.Run(ctx)) + group := errgroup.Group{} + + group.Go(func() error { + return errs2.IgnoreCanceled(peer.Server.Run(ctx)) + }) + + group.Go(func() error { + return errs2.IgnoreCanceled(peer.Authorization.Endpoint.Run(ctx)) + }) + + return group.Wait() } // Close closes all resources.