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

Added --force-watch option. #110

Merged
merged 1 commit into from
Aug 14, 2013
Merged

Conversation

thomaschaaf
Copy link
Contributor

This forces the use of fs.watch instead of fs.watchFile.

I added this option as I constantly having a CPU load of 100% on 5 files on Windows 7 x64 with an ssd and node 0.10.15.

This forces the use of fs.watch instead of fs.watchFile.
@iangreenleaf
Copy link
Collaborator

Thanks. This seems like a good idea. This is very much a temporary flag, as we can hopefully reach one solution that works well for all systems, but I'm happy to go with this as a stopgap measure.

iangreenleaf added a commit that referenced this pull request Aug 14, 2013
Added --force-watch option.

This option is *experimental* and likely *temporary*. Only use it if you are having trouble with high CPU usage.
@iangreenleaf iangreenleaf merged commit c6630e1 into petruisfan:master Aug 14, 2013
@thomaschaaf
Copy link
Contributor Author

:) No Problem. In the official documentation I read that fs.watchFile is not recommended anymore. Have you thought about removing it completely? (http://nodejs.org/api/fs.html#fs_fs_watchfile_filename_options_listener)

@iangreenleaf
Copy link
Collaborator

Yes, I would very much like to unify everything under a single stable solution (see #71).

We've looked at it in the past, and had a couple hurdles to deal with. There were some filesystem problems with too many file handles or the like (#34), but it's possible those are fixed in newer versions of Node. There is also the problem that fs.watch doesn't provide file names on all platforms, which breaks some existing features. It might be possible to work around this, but I simply haven't had much time to dedicate to this project. If you feel like taking a crack at it, I'd be more than happy to see what you can come up with. Here's what I'd want to see in the ultimate solution.

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.

2 participants