add file poller panic fix from 1.10.2

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2016-02-23 21:36:04 -05:00
parent d932514e7e
commit c8da8b3693
2 changed files with 1 additions and 20 deletions

View file

@ -118,8 +118,6 @@ func (w *filePoller) Close() error {
w.remove(name)
delete(w.watches, name)
}
close(w.events)
close(w.errors)
return nil
}
@ -146,6 +144,7 @@ func (w *filePoller) sendErr(e error, chClose <-chan struct{}) error {
// watch is responsible for polling the specified file for changes
// upon finding changes to a file or errors, sendEvent/sendErr is called
func (w *filePoller) watch(f *os.File, lastFi os.FileInfo, chClose chan struct{}) {
defer f.Close()
for {
time.Sleep(watchWaitTime)
select {