From 119c8a6b43a14d3893df33ee6a1902658d29b821 Mon Sep 17 00:00:00 2001 From: Pavlo Strokov Date: Mon, 15 Feb 2021 12:48:44 +0200 Subject: Gitaly-ruby server should be a provided dependency Server factory should not manage gitaly-ruby server internally as it completely independent entity and should be provided only as a dependency into other components. The change also restructure creation of the gRPC servers by the factory, so that doesn't rely on the specific services. This gives us un opportunity to re-use setup code in the tests and remove the helpers that are not complete compared to actual production used. --- cmd/praefect/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmd/praefect/main.go') diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 6ce7b2ed1..85719caa6 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -407,7 +407,11 @@ func run(cfgs []starter.Config, conf config.Config) error { b.StopAction = srvFactory.GracefulStop for _, cfg := range cfgs { - b.RegisterStarter(starter.New(cfg, srvFactory)) + srv, err := srvFactory.Create(cfg.IsSecure()) + if err != nil { + return fmt.Errorf("create gRPC server: %w", err) + } + b.RegisterStarter(starter.New(cfg, srv)) } if conf.PrometheusListenAddr != "" { -- cgit v1.2.3