Skip to content

Fallback on PollWatcher#18

Open
evanr70 wants to merge 3 commits intokarimknaebel:mainfrom
evanr70:inotify-limit
Open

Fallback on PollWatcher#18
evanr70 wants to merge 3 commits intokarimknaebel:mainfrom
evanr70:inotify-limit

Conversation

@evanr70
Copy link
Contributor

@evanr70 evanr70 commented Sep 29, 2023

Users may not have control over the max watches limit of the recommended_watcher. In this case, it is desirable to fallback to the PollWatcher implementation which is x-platform as far as I can tell and shouldn't experience the same restriction.

To check if the watcher limit has been reached, we create a NamedTempFile using tempfile and check the result of watcher.watch on the recommended_watcher.

I've also removed some unwraps which were causing problems. Some are replaced with match blocks, others with bindings. I can't see any immediate problems from this, but it might be worth checking it out.

The checking code might be better off in a separate function which returns a Box<dyn Watcher> so can do that if you'd prefer.

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.

1 participant