[MM-34179] app: move cluster registeration to server creation (#17306)

* app: move cluster registeration to server creation

* initserver via fakeapp

* reflect review comments
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2021-04-01 11:29:56 +03:00
коммит произвёл GitHub
родитель 756f5fbff3
Коммит e13d85d8c7
9 изменённых файлов: 116 добавлений и 148 удалений

Просмотреть файл

@@ -111,6 +111,13 @@ func runServer(configStore *config.Store, usedPlatform bool, interruptChan chan
return serverErr
}
// TODO: remove this and handle all required initialization while creating
// the server. In theory, we shouldn't depend on App to have a fully-featured
// server. This initialization is added so that cluster handlers are registered
// and job schedulers are initialized.
fakeApp := app.New(app.ServerConnector(server))
fakeApp.InitServer()
// If we allow testing then listen for manual testing URL hits
if *server.Config().ServiceSettings.EnableTesting {
manualtesting.Init(api)