-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Hi! This isn't an issue request so much as a discussion, but I had a question about the implementation that I wanted to ask about.
In jurigged.live::Watcher::on_prepare we end up self.observer.schedule-ing once per-directory:
Lines 96 to 98 in afed805
| def on_prepare(self, module_name, filename): | |
| JuriggedHandler(self, filename).schedule(self.observer) | |
| self.registry.log(WatchOperation(filename)) |
Lines 150 to 154 in afed805
| def schedule(self, observer): | |
| # Watch the directory, because when watching a file, the watcher stops when | |
| # it is deleted and will not pick back up if the file is recreated. This happens | |
| # when some editors save. | |
| observer.schedule(self, os.path.dirname(self.filename)) |
This can run into OS-level limits on the number of file watchers available, which causes jurigged to fail on large projects. I've been messing around with this on such a project, and found a workaround by monkeypatching Watcher instead use a single watchdog.Observer.
I was wondering: is this a bad idea for a reason I don't understand yet? And if not: any chance y'all would accept a pull request to make this change?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels