guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.93k stars 247 forks source link

BSD: Don't send ignored paths to kqueue #538

Closed jcs closed 3 years ago

jcs commented 3 years ago

I'm using this via Jekyll's --watch option and on OpenBSD I either have to get a CPU-eating poll of its giant directory structure (because of .git and vendor/bundle) or I use rb-kqueue and the process quickly dies after running out of file handles.

Since the paths being ignored by the Silencer aren't used anyway, can it just not pass them to kqueue and avoid watching them?

ColinDKelley commented 3 years ago

@jcs Thank you for the PR.

Can you please add tests? At least for these cases:

ColinDKelley commented 3 years ago

Hi @jcs Just checking in here to see if you can write those 3 tests?

ColinDKelley commented 3 years ago

Hi @jcs Just checking in again to see if you can write those 3 tests? LMK if you need help with them.

ColinDKelley commented 3 years ago

@jcs Can you check out v3.7.0 that was just released and see if the optimization from #542 winds being equivalent to the kqueue optimization in this PR?

jcs commented 3 years ago

It appears so, thanks!

ColinDKelley commented 3 years ago

Excellent! Thanks @jcs for looking into this.