diff options
author | Corey Hulen <corey@hulen.com> | 2017-04-17 07:55:03 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-04-17 10:55:03 -0400 |
commit | acc991dea1f97e5eb93cbb1c861925d24114caca (patch) | |
tree | f7abbf45448da746dc298790e3068c616f52ccfb /utils | |
parent | 32078865147dc4779023e036aba164842067e58b (diff) | |
download | chat-acc991dea1f97e5eb93cbb1c861925d24114caca.tar.gz chat-acc991dea1f97e5eb93cbb1c861925d24114caca.tar.bz2 chat-acc991dea1f97e5eb93cbb1c861925d24114caca.zip |
PLT-6317 disable file watcher while running from makefile (#6103)
* PLT-6317 disable file watcher while running from make file
* Removing debug stmt
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/utils/config.go b/utils/config.go index 14f151d2d..a4ec82078 100644 --- a/utils/config.go +++ b/utils/config.go @@ -36,6 +36,7 @@ var Cfg *model.Config = &model.Config{} var CfgDiagnosticId = "" var CfgHash = "" var CfgFileName string = "" +var CfgDisableConfigWatch = false var ClientCfg map[string]string = map[string]string{} var originalDisableDebugLvl l4g.Level = l4g.DEBUG var siteURL = "" @@ -178,6 +179,10 @@ func InitializeConfigWatch() { cfgMutex.Lock() defer cfgMutex.Unlock() + if CfgDisableConfigWatch { + return + } + if watcher == nil { var err error watcher, err = fsnotify.NewWatcher() @@ -215,11 +220,13 @@ func EnableConfigWatch() { cfgMutex.Lock() defer cfgMutex.Unlock() - configFile := filepath.Clean(CfgFileName) - configDir, _ := filepath.Split(configFile) - if watcher != nil { - watcher.Add(configDir) + configFile := filepath.Clean(CfgFileName) + configDir, _ := filepath.Split(configFile) + + if watcher != nil { + watcher.Add(configDir) + } } } |