Reduce utils.Cfg references (#7650)
* app.UpdateConfig method * test fix * another test fix * the config override option as-was is just error prone, remove it for now * derp
Этот коммит содержится в:
10
app/app.go
10
app/app.go
@@ -47,8 +47,7 @@ type App struct {
|
||||
Mfa einterfaces.MfaInterface
|
||||
Saml einterfaces.SamlInterface
|
||||
|
||||
newStore func() store.Store
|
||||
configOverride func(*model.Config) *model.Config
|
||||
newStore func() store.Store
|
||||
}
|
||||
|
||||
var appCount = 0
|
||||
@@ -234,12 +233,13 @@ func (a *App) initEnterprise() {
|
||||
}
|
||||
|
||||
func (a *App) Config() *model.Config {
|
||||
if a.configOverride != nil {
|
||||
return a.configOverride(utils.Cfg)
|
||||
}
|
||||
return utils.Cfg
|
||||
}
|
||||
|
||||
func (a *App) UpdateConfig(f func(*model.Config)) {
|
||||
f(utils.Cfg)
|
||||
}
|
||||
|
||||
// Go creates a goroutine, but maintains a record of it to ensure that execution completes before
|
||||
// the app is destroyed.
|
||||
func (a *App) Go(f func()) {
|
||||
|
||||
Ссылка в новой задаче
Block a user