коммит произвёл
Christopher Speller
родитель
01e652ed48
Коммит
816a30397d
@@ -55,6 +55,8 @@ type App struct {
|
||||
|
||||
htmlTemplateWatcher *utils.HTMLTemplateWatcher
|
||||
sessionCache *utils.Cache
|
||||
roles map[string]*model.Role
|
||||
configListenerId string
|
||||
}
|
||||
|
||||
var appCount = 0
|
||||
@@ -86,6 +88,11 @@ func New(options ...Option) *App {
|
||||
utils.LoadGlobalConfig(app.configFile)
|
||||
utils.InitTranslations(utils.Cfg.LocalizationSettings)
|
||||
|
||||
app.configListenerId = utils.AddConfigListener(func(_, cfg *model.Config) {
|
||||
app.SetDefaultRolesBasedOnConfig()
|
||||
})
|
||||
app.SetDefaultRolesBasedOnConfig()
|
||||
|
||||
l4g.Info(utils.T("api.server.new_server.init.info"))
|
||||
|
||||
app.initEnterprise()
|
||||
@@ -137,6 +144,7 @@ func (a *App) Shutdown() {
|
||||
a.htmlTemplateWatcher.Close()
|
||||
}
|
||||
|
||||
utils.RemoveConfigListener(a.configListenerId)
|
||||
l4g.Info(utils.T("api.server.stop_server.stopped.info"))
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user