diff options
author | George Goldberg <george@gberg.me> | 2017-04-05 19:10:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 19:10:20 +0100 |
commit | 87343176fcc01eb064def97a913157e3967ffcc6 (patch) | |
tree | ff122a153da562c2d49d193a7f815ffbd2382c2d /utils/config.go | |
parent | 997b35d2fc482e2629251ed4c9d298644bbdf097 (diff) | |
download | chat-87343176fcc01eb064def97a913157e3967ffcc6.tar.gz chat-87343176fcc01eb064def97a913157e3967ffcc6.tar.bz2 chat-87343176fcc01eb064def97a913157e3967ffcc6.zip |
PLT-5977: Only reload clients when client config changes. (#5989)
Diffstat (limited to 'utils/config.go')
-rw-r--r-- | utils/config.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/config.go b/utils/config.go index 2e41f8431..8c80d5349 100644 --- a/utils/config.go +++ b/utils/config.go @@ -35,6 +35,7 @@ var watcher *fsnotify.Watcher var Cfg *model.Config = &model.Config{} var CfgDiagnosticId = "" var CfgHash = "" +var ClientCfgHash = "" var CfgFileName string = "" var ClientCfg map[string]string = map[string]string{} var originalDisableDebugLvl l4g.Level = l4g.DEBUG @@ -313,6 +314,8 @@ func LoadConfig(fileName string) { Cfg = &config CfgHash = fmt.Sprintf("%x", md5.Sum([]byte(Cfg.ToJson()))) ClientCfg = getClientConfig(Cfg) + clientCfgJson, _ := json.Marshal(ClientCfg) + ClientCfgHash = fmt.Sprintf("%x", md5.Sum(clientCfgJson)) // Actions that need to run every time the config is loaded if ldapI := einterfaces.GetLdapInterface(); ldapI != nil { |