Skip to content

Commit

Permalink
Ignore spurious filesystem changes
Browse files Browse the repository at this point in the history
  • Loading branch information
euank committed Jan 19, 2017
1 parent d81b150 commit 6e94871
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ func GetDirInodeUsage(dir string, timeout time.Duration) (uint64, error) {
inodes := map[uint64]struct{}{}

err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if os.IsNotExist(err) {
// expected if files appear/vanish
return nil
}
if err != nil {
return fmt.Errorf("unable to count inodes for part of dir %s: %s", dir, err)
}
Expand Down

0 comments on commit 6e94871

Please sign in to comment.