diff options
Diffstat (limited to 'cmd/praefect')
-rw-r--r-- | cmd/praefect/main.go | 1 | ||||
-rw-r--r-- | cmd/praefect/subcmd_track_repository_test.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 8b56cab28..743578b1b 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -340,6 +340,7 @@ func run(cfgs []starter.Config, conf config.Config) error { nodeManager = nodeMgr nodeMgr.Start(conf.Failover.BootstrapInterval.Duration(), conf.Failover.MonitorInterval.Duration()) + defer nodeMgr.Stop() } logger.Infof("election strategy: %q", conf.Failover.ElectionStrategy) diff --git a/cmd/praefect/subcmd_track_repository_test.go b/cmd/praefect/subcmd_track_repository_test.go index bdf29ce68..c03329eb1 100644 --- a/cmd/praefect/subcmd_track_repository_test.go +++ b/cmd/praefect/subcmd_track_repository_test.go @@ -154,6 +154,7 @@ func TestAddRepository_Exec(t *testing.T) { nodeMgr, err := nodes.NewManager(testhelper.DiscardTestEntry(t), addCmdConf, db.DB, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil) require.NoError(t, err) nodeMgr.Start(0, time.Hour) + defer nodeMgr.Stop() relativePath := fmt.Sprintf("path/to/test/repo_%s", tn) repoDS := datastore.NewPostgresRepositoryStore(db, conf.StorageNames()) |