diff options
author | 2016-11-09 10:02:52 +0000 | |
---|---|---|
committer | 2016-11-09 10:02:52 +0000 | |
commit | e210b06e89aff164d03a44df748f620b331c5481 (patch) | |
tree | 37da30ba4f24c46ffe4b46ac428f291f5e29652b | |
parent | 4ef53081c536a66acf77c7b1e3df15c2fc0ca52b (diff) | |
download | coredns-e210b06e89aff164d03a44df748f620b331c5481.tar.gz coredns-e210b06e89aff164d03a44df748f620b331c5481.tar.zst coredns-e210b06e89aff164d03a44df748f620b331c5481.zip |
middleware/file: also react to rename events. (#406)
* middleware/file: also react to rename events.
* React to all events
-rw-r--r-- | middleware/file/zone.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/middleware/file/zone.go b/middleware/file/zone.go index 3636c04bd..21571287d 100644 --- a/middleware/file/zone.go +++ b/middleware/file/zone.go @@ -168,9 +168,7 @@ func (z *Zone) Reload() error { for { select { case event := <-watcher.Events: - // Looks for Write and Create events. Write is obvious, Create is used when - // a file is mv-ed into this place. - if (event.Op == fsnotify.Write || event.Op == fsnotify.Create) && path.Clean(event.Name) == z.file { + if path.Clean(event.Name) == z.file { reader, err := os.Open(z.file) if err != nil { |