This commit is contained in:
Liang Ding 2015-09-26 18:31:57 +08:00
parent 151757cc8a
commit b758ec854e
1 changed files with 1 additions and 5 deletions

View File

@ -352,17 +352,13 @@ func (sessions *wSessions) New(httpSession *sessions.Session, sid string) *WideS
return // release this gorutine return // release this gorutine
} }
logger.Info(event) logger.Debug(event)
if event.Op&fsnotify.Create == fsnotify.Create { if event.Op&fsnotify.Create == fsnotify.Create {
if err = watcher.Add(path); nil != err { if err = watcher.Add(path); nil != err {
logger.Warn(err, path) logger.Warn(err, path)
} }
if util.File.IsDir(path) {
break
}
logger.Tracef("File watcher added a file [%s]", path) logger.Tracef("File watcher added a file [%s]", path)
cmd := map[string]interface{}{"path": path, "dir": dir, "cmd": "create-file"} cmd := map[string]interface{}{"path": path, "dir": dir, "cmd": "create-file"}