diff options
author | 2016-04-15 17:09:01 +0000 | |
---|---|---|
committer | 2016-04-15 17:09:01 +0000 | |
commit | aa0ba0c3b4376c55f78091cac58e2237fc5c91ec (patch) | |
tree | 24044caf9ef1e4051a173ee0b5ba423a4650f2e9 | |
parent | 9b82cca9e23f53ab5999c4e614170045bf31a969 (diff) | |
download | coredns-aa0ba0c3b4376c55f78091cac58e2237fc5c91ec.tar.gz coredns-aa0ba0c3b4376c55f78091cac58e2237fc5c91ec.tar.zst coredns-aa0ba0c3b4376c55f78091cac58e2237fc5c91ec.zip |
Re-add the watcher
-rw-r--r-- | middleware/file/zone.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/middleware/file/zone.go b/middleware/file/zone.go index 40389f5a4..41be5267c 100644 --- a/middleware/file/zone.go +++ b/middleware/file/zone.go @@ -118,6 +118,10 @@ func (z *Zone) Reload(shutdown chan bool) error { select { case event := <-watcher.Events: 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) if err != nil { log.Printf("[ERROR] Failed to open `%s' for `%s': %v", z.file, z.origin, err) |