summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-04-04 08:24:58 -0700
committerChristopher Speller <crspeller@gmail.com>2017-04-04 11:24:58 -0400
commitf0e451a2d3d2899a7a0566391d7fafe5578f5692 (patch)
tree7b635385110a537af023fa5d9b27d87b4b429ec2 /app
parentc4fd04efb642b42b5829e25b4fc5d8b389fff8de (diff)
downloadchat-f0e451a2d3d2899a7a0566391d7fafe5578f5692.tar.gz
chat-f0e451a2d3d2899a7a0566391d7fafe5578f5692.tar.bz2
chat-f0e451a2d3d2899a7a0566391d7fafe5578f5692.zip
Fixing config file watch and config reload on license save (#5954)
* Fixing config file watch and config reload on license save * Fixing config file watch and config reload on license save * Fixing build error * Fixing locking issue
Diffstat (limited to 'app')
-rw-r--r--app/admin.go2
-rw-r--r--app/license.go3
2 files changed, 5 insertions, 0 deletions
diff --git a/app/admin.go b/app/admin.go
index 509d81840..b86eb5993 100644
--- a/app/admin.go
+++ b/app/admin.go
@@ -137,8 +137,10 @@ func SaveConfig(cfg *model.Config) *model.AppError {
}
//oldCfg := utils.Cfg
+ utils.DisableConfigWatch()
utils.SaveConfig(utils.CfgFileName, cfg)
utils.LoadConfig(utils.CfgFileName)
+ utils.EnableConfigWatch()
if einterfaces.GetMetricsInterface() != nil {
if *utils.Cfg.MetricsSettings.Enable {
diff --git a/app/license.go b/app/license.go
index 6b448b19d..c41c17fd8 100644
--- a/app/license.go
+++ b/app/license.go
@@ -100,6 +100,9 @@ func SaveLicense(licenseBytes []byte) (*model.License, *model.AppError) {
return nil, model.NewLocAppError("addLicense", model.INVALID_LICENSE_ERROR, nil, "")
}
+ ReloadConfig()
+ InvalidateAllCaches()
+
return license, nil
}