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
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/gitaly/main.go')
-rw-r--r--cmd/gitaly/main.go37
1 files changed, 21 insertions, 16 deletions
diff --git a/cmd/gitaly/main.go b/cmd/gitaly/main.go
index dd4243003..be48a6c20 100644
--- a/cmd/gitaly/main.go
+++ b/cmd/gitaly/main.go
@@ -29,6 +29,7 @@ import (
"gitlab.com/gitlab-org/gitaly/v14/internal/gitlab"
glog "gitlab.com/gitlab-org/gitaly/v14/internal/log"
"gitlab.com/gitlab-org/gitaly/v14/internal/storage"
+ "gitlab.com/gitlab-org/gitaly/v14/internal/streamrpc"
"gitlab.com/gitlab-org/gitaly/v14/internal/tempdir"
"gitlab.com/gitlab-org/gitaly/v14/internal/version"
"gitlab.com/gitlab-org/labkit/monitoring"
@@ -196,6 +197,19 @@ func run(cfg config.Cfg) error {
}
defer rubySrv.Stop()
+ deps := &service.Dependencies{
+ Cfg: cfg,
+ RubyServer: rubySrv,
+ GitalyHookManager: hookManager,
+ TransactionManager: transactionManager,
+ StorageLocator: locator,
+ ClientPool: conns,
+ GitCmdFactory: gitCmdFactory,
+ Linguist: ling,
+ CatfileCache: catfileCache,
+ DiskCache: diskCache,
+ }
+
for _, c := range []starter.Config{
{Name: starter.Unix, Addr: cfg.SocketPath, HandoverOnUpgrade: true},
{Name: starter.Unix, Addr: cfg.GitalyInternalSocketPath(), HandoverOnUpgrade: false},
@@ -206,32 +220,23 @@ func run(cfg config.Cfg) error {
continue
}
- var srv *grpc.Server
+ var grpcSrv *grpc.Server
+ var srpcSrv *streamrpc.Server
if c.HandoverOnUpgrade {
- srv, err = gitalyServerFactory.CreateExternal(c.IsSecure())
+ grpcSrv, srpcSrv, err = gitalyServerFactory.CreateExternal(c.IsSecure())
if err != nil {
return fmt.Errorf("create external gRPC server: %w", err)
}
} else {
- srv, err = gitalyServerFactory.CreateInternal()
+ grpcSrv, srpcSrv, err = gitalyServerFactory.CreateInternal()
if err != nil {
return fmt.Errorf("create internal gRPC server: %w", err)
}
}
- setup.RegisterAll(srv, &service.Dependencies{
- Cfg: cfg,
- RubyServer: rubySrv,
- GitalyHookManager: hookManager,
- TransactionManager: transactionManager,
- StorageLocator: locator,
- ClientPool: conns,
- GitCmdFactory: gitCmdFactory,
- Linguist: ling,
- CatfileCache: catfileCache,
- DiskCache: diskCache,
- })
- b.RegisterStarter(starter.New(c, srv))
+ setup.RegisterAll(grpcSrv, deps)
+ setup.RegisterAll(srpcSrv, deps)
+ b.RegisterStarter(starter.New(c, grpcSrv))
}
if addr := cfg.PrometheusListenAddr; addr != "" {