From bf6bb9bce9723799991478e5aea745686045ad65 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 16 Nov 2017 08:40:26 -0600 Subject: fix config cli option (#7850) --- app/app.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'app/app.go') diff --git a/app/app.go b/app/app.go index 81db20830..4be897f59 100644 --- a/app/app.go +++ b/app/app.go @@ -48,7 +48,8 @@ type App struct { Mfa einterfaces.MfaInterface Saml einterfaces.SamlInterface - newStore func() store.Store + configFile string + newStore func() store.Store sessionCache *utils.Cache } @@ -63,27 +64,29 @@ func New(options ...Option) *App { panic("Only one App should exist at a time. Did you forget to call Shutdown()?") } - if utils.T == nil { - utils.TranslationsPreInit() - } - utils.LoadGlobalConfig("config.json") - utils.InitTranslations(utils.Cfg.LocalizationSettings) - - l4g.Info(utils.T("api.server.new_server.init.info")) - app := &App{ goroutineExitSignal: make(chan struct{}, 1), Srv: &Server{ Router: mux.NewRouter(), }, sessionCache: utils.NewLru(model.SESSION_CACHE_SIZE), + configFile: "config.json", } - app.initEnterprise() for _, option := range options { option(app) } + if utils.T == nil { + utils.TranslationsPreInit() + } + utils.LoadGlobalConfig(app.configFile) + utils.InitTranslations(utils.Cfg.LocalizationSettings) + + l4g.Info(utils.T("api.server.new_server.init.info")) + + app.initEnterprise() + if app.newStore == nil { app.newStore = func() store.Store { return store.NewLayeredStore(sqlstore.NewSqlSupplier(app.Config().SqlSettings, app.Metrics), app.Metrics, app.Cluster) -- cgit v1.2.3-1-g7c22