diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-10-06 13:58:23 -0400 |
---|---|---|
committer | Chris <ccbrown112@gmail.com> | 2017-10-06 10:58:23 -0700 |
commit | d1958bdc49cd10277ca2e27bb2eea499c5994954 (patch) | |
tree | 67eaceacc38437e153bb08e2ac3d0f15011e116f /cmd/platform | |
parent | 6097e3f02b6e5b2d9e320f0e1b8baa59c9a06af7 (diff) | |
download | chat-d1958bdc49cd10277ca2e27bb2eea499c5994954.tar.gz chat-d1958bdc49cd10277ca2e27bb2eea499c5994954.tar.bz2 chat-d1958bdc49cd10277ca2e27bb2eea499c5994954.zip |
Do not require server restart when enabling/disabling plugins (#7592)
Diffstat (limited to 'cmd/platform')
-rw-r--r-- | cmd/platform/server.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/platform/server.go b/cmd/platform/server.go index 7ee7097e7..ac3f645c2 100644 --- a/cmd/platform/server.go +++ b/cmd/platform/server.go @@ -76,8 +76,18 @@ func runServer(configFileLocation string) { a.LoadLicense() } + a.InitBuiltInPlugins() + if webappDir, ok := utils.FindDir(model.CLIENT_DIR); ok { a.InitPlugins("plugins", webappDir+"/plugins") + + utils.AddConfigListener(func(prevCfg *model.Config, cfg *model.Config) { + if !*prevCfg.PluginSettings.Enable && *cfg.PluginSettings.Enable { + a.InitPlugins("plugins", webappDir+"/plugins") + } else if *prevCfg.PluginSettings.Enable && !*cfg.PluginSettings.Enable { + a.ShutDownPlugins() + } + }) } else { l4g.Error("Unable to find webapp directory, could not initialize plugins") } |