diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-11-03 17:47:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-03 17:47:52 -0400 |
commit | 2acb5486157691c5b52656f7b45e0a2ab18d1c68 (patch) | |
tree | ce8f69cd639befb59922218282e158690d2fd2e2 /cmd/platform | |
parent | 2dda86b25d8c4acf8cac354e34d446cc6603f406 (diff) | |
download | chat-2acb5486157691c5b52656f7b45e0a2ab18d1c68.tar.gz chat-2acb5486157691c5b52656f7b45e0a2ab18d1c68.tar.bz2 chat-2acb5486157691c5b52656f7b45e0a2ab18d1c68.zip |
PLT-8086 Fix plugin config watcher for enabling and disabling (#7770)
* Fix plugin config watcher for enabling and disabling
* Make sure HTTP routes are served
* Set content-type explicitly
Diffstat (limited to 'cmd/platform')
-rw-r--r-- | cmd/platform/server.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/platform/server.go b/cmd/platform/server.go index 6de14d63e..93bc00f88 100644 --- a/cmd/platform/server.go +++ b/cmd/platform/server.go @@ -75,6 +75,13 @@ func runServer(configFileLocation string) { if webappDir, ok := utils.FindDir(model.CLIENT_DIR); ok { a.InitPlugins(*a.Config().PluginSettings.Directory, webappDir+"/plugins") + utils.AddConfigListener(func(prevCfg, cfg *model.Config) { + if *cfg.PluginSettings.Enable { + a.InitPlugins(*cfg.PluginSettings.Directory, webappDir+"/plugins") + } else { + a.ShutDownPlugins() + } + }) } else { l4g.Error("Unable to find webapp directory, could not initialize plugins") } |