fix: BlockUntilExists should only return if filename matches
This commit is contained in:
parent
507783a4a0
commit
adcb2e389d
7
watch.go
7
watch.go
|
@ -36,7 +36,12 @@ func (fw *InotifyFileWatcher) BlockUntilExists() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer w.RemoveWatch(filepath.Dir(fw.Filename))
|
defer w.RemoveWatch(filepath.Dir(fw.Filename))
|
||||||
<-w.Event
|
for {
|
||||||
|
evt := <-w.Event
|
||||||
|
if evt.Name == fw.Filename {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue