diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-02-15 13:48:44 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-02-17 10:58:07 +0300 |
commit | 119c8a6b43a14d3893df33ee6a1902658d29b821 (patch) | |
tree | 80e6316b6805778cb1d6cc795737fce925a94081 /cmd/praefect/main.go | |
parent | 2e496084f31e2f8aab5cc7e48752bc7e2ceb2897 (diff) |
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.
Diffstat (limited to 'cmd/praefect/main.go')
-rw-r--r-- | cmd/praefect/main.go | 6 |
1 files changed, 5 insertions, 1 deletions
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 != "" { |