Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip ignored files before callbacks #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

technoweenie
Copy link

This updates listRecursive() to check the ignored or hidden status of a file path before calling the filter hooks. This can have massive CPU savings if the watcher ignores a massive sub directory in a recursively-watched directory.

It's also consistent with list():

watcher/watcher.go

Lines 260 to 272 in f5989f8

if ignored || (w.ignoreHidden && isHidden) {
continue
}
for _, f := range w.ffh {
err := f(fInfo, path)
if err == ErrSkip {
continue outer
}
if err != nil {
return nil, err
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant