Log failure to close fsnotify handle (#1250)

This commit is contained in:
Richard Connon
2018-09-28 12:06:43 +01:00
committed by GitHub
parent f9e4f93ad6
commit 8d8c7df569

View File

@@ -1105,7 +1105,11 @@ func inotifyAwait(ctx context.Context, iofsDir string) error {
if err != nil {
return fmt.Errorf("error getting fsnotify watcher: %v", err)
}
defer fsWatcher.Close()
defer func() {
if err := fsWatcher.Close(); err != nil {
common.Logger(ctx).WithError(err).Error("Failed to close inotify watcher")
}
}()
err = fsWatcher.Add(iofsDir)
if err != nil {