Add configFile(s) back to the watch list after REMOVE event

Fixes #4701
This commit is contained in:
Anthony Fok authored and Bjørn Erik Pedersen committed 2018-08-16 16:11:57 +02:00
1 parent a655e00d70
commit abc54080ec
1 file changed
+12
+12
View File
@@ -705,6 +705,18 @@ func (c *commandeer) newWatcher(dirList ...string) (*watcher.Batcher, error) {
if ev.Op&fsnotify.Chmod == fsnotify.Chmod { if ev.Op&fsnotify.Chmod == fsnotify.Chmod {
continue continue
} }
if ev.Op&fsnotify.Remove == fsnotify.Remove {
for _, configFile := range c.configFiles {
counter := 0
for watcher.Add(configFile) != nil {
counter++
if counter >= 100 {
break
}
time.Sleep(100 * time.Millisecond)
}
}
}
// Config file changed. Need full rebuild. // Config file changed. Need full rebuild.
c.fullRebuild() c.fullRebuild()
break break