middleware/file: also react to rename events. (#406)

* middleware/file: also react to rename events.

* React to all events
This commit is contained in:
Miek Gieben 2016-11-09 10:02:52 +00:00 committed by GitHub
parent 4ef53081c5
commit e210b06e89

View file

@ -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 {