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

Fixes #4701
This commit is contained in:
Anthony Fok 2018-08-15 20:51:27 -06:00 committed by Bjørn Erik Pedersen
parent a655e00d70
commit abc54080ec

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