* remove global config watcher

* keep config watcher disabled for tests

* compile fix

* fix resource leak
Этот коммит содержится в:
Chris
2018-01-11 15:23:41 -06:00
коммит произвёл Corey Hulen
родитель 6990d052d5
Коммит 1d9efd0e39
12 изменённых файлов: 215 добавлений и 175 удалений

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

@@ -173,13 +173,13 @@ func (a *App) SaveConfig(cfg *model.Config, sendConfigChangeClusterMessage bool)
return model.NewAppError("saveConfig", "ent.cluster.save_config.error", nil, "", http.StatusForbidden)
}
utils.DisableConfigWatch()
a.DisableConfigWatch()
a.UpdateConfig(func(update *model.Config) {
*update = *cfg
})
a.PersistConfig()
a.ReloadConfig()
utils.EnableConfigWatch()
a.EnableConfigWatch()
if a.Metrics != nil {
if *a.Config().MetricsSettings.Enable {