[MM-60648] Don't start server until all routes are registered (#28291)

Этот коммит содержится в:
Ben Schumacher
2024-09-26 13:57:48 +02:00
коммит произвёл GitHub
родитель 20ed58906a
Коммит 3428cd15b6
3 изменённых файлов: 9 добавлений и 14 удалений

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

@@ -18,7 +18,6 @@ import (
"github.com/mattermost/mattermost/server/public/shared/mlog"
"github.com/mattermost/mattermost/server/v8/channels/api4"
"github.com/mattermost/mattermost/server/v8/channels/app"
"github.com/mattermost/mattermost/server/v8/channels/manualtesting"
"github.com/mattermost/mattermost/server/v8/channels/utils"
"github.com/mattermost/mattermost/server/v8/channels/web"
"github.com/mattermost/mattermost/server/v8/channels/wsapi"
@@ -93,11 +92,12 @@ func runServer(configStore *config.Store, interruptChan chan os.Signal) error {
}
}()
api, err := api4.Init(server)
_, err = api4.Init(server)
if err != nil {
mlog.Error(err.Error())
return err
}
wsapi.Init(server)
web.New(server)
@@ -107,11 +107,6 @@ func runServer(configStore *config.Store, interruptChan chan os.Signal) error {
return err
}
// If we allow testing then listen for manual testing URL hits
if *server.Config().ServiceSettings.EnableTesting {
manualtesting.Init(api)
}
notifyReady()
// wait for kill signal before attempting to gracefully shutdown