import (
"strings"
+ "os"
confdescription "configuremgr/description"
cfg := new(confdescription.Doc)
libPath, confPath := cfgMgr.getdirname(path)
+
+ //NOTE : copy but really copy, it can be not existed.
+ for {
+ if _, err := os.Stat(confPath); os.IsNotExist(err) {
+
+ }else{
+ break
+ }
+ }
sconf.Must(cfg).Read(ini.File(confPath))
cfgMgr.IScoringMgr.PushLibPath(libPath, cfg, cfgMgr.IScoringMgr.Ch)
cfgMgr.IDiscoveryMgr.PushConfPath(cfg)
// cfgMgr.IAppExecuteMgr.PushConfPath(cfg)
-
}
func (cfgMgr *ConfigureMgr) getdirname(path string) (libPath, confPath string) {
}
ILog.Println("log event:", event)
- if event.Op & fsnotify.Create == fsnotify.Create {
- cfgMgr.installConfigure(event.Name)
+ switch(event.Op){
+ case fsnotify.Create:
+ // case fsnotify.Chmod:
+ cfgMgr.installConfigure(event.Name)
+
}
+
case err, ok := <-watcher.Errors:
if !ok {
return
}
ELog.Println("error:", err)
- }
- }
+
+ } //selecte end
+ } //for end
}()
err = watcher.Add(path)
if err != nil {
ELog.Fatal(err)
}
-
- <- cfgMgr.Done
+ <- cfgMgr.Done
ILog.Println("configuremgr watch end")
}
\ No newline at end of file