Commit aa0ba0c3 authored by Miek Gieben's avatar Miek Gieben

Re-add the watcher

parent 9b82cca9
...@@ -118,6 +118,10 @@ func (z *Zone) Reload(shutdown chan bool) error { ...@@ -118,6 +118,10 @@ func (z *Zone) Reload(shutdown chan bool) error {
select { select {
case event := <-watcher.Events: case event := <-watcher.Events:
if event.Op&fsnotify.Write == fsnotify.Write || event.Op&fsnotify.Rename == fsnotify.Rename { if event.Op&fsnotify.Write == fsnotify.Write || event.Op&fsnotify.Rename == fsnotify.Rename {
if err := watcher.Add(z.file); err != nil {
log.Printf("[ERROR] Failed to open `%s' for `%s': %v", z.file, z.origin, err)
}
reader, err := os.Open(z.file) reader, err := os.Open(z.file)
if err != nil { if err != nil {
log.Printf("[ERROR] Failed to open `%s' for `%s': %v", z.file, z.origin, err) log.Printf("[ERROR] Failed to open `%s' for `%s': %v", z.file, z.origin, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment