-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
Unwatch is not unwatching folders #273
Comments
What is different about your situation compared with what's being done in the passing tests at https://github.com/paulmillr/chokidar/blob/master/test.js#L1171-1215 ? If you run the tests in your environment, do they pass? |
Quite honestly, I was following the examples on github as it appeared straight-forward enough. I currently cannot run the test you directed me to since there are many other modules that I need to install. Thought this was going to be a "quickie" to get this working. I looked through the test, and with the exception of the getFixturePath function it appears the same. Still looking, but unsure why unwatch wouldn't do it. Thanks for your input. |
Seems like the only way I could get this to work was creating multiple watchers - e.g.
Just doesn't seem right. If anyone else can help it is appreciated. |
Actually that's a good point and it may be relevant - the difference between relative and absolute paths. I'll try it out when I get a chance. |
Thanks. I appreciate anything you can offer. Your Library is great and we'll written Robert
|
I added a test using unwatch with relative paths, but it passes. |
I've tried this in several different ways but cannot get the unwatch to happen unless I use the "two-watcher" approach I described above. Currently I'm watching local directories but will eventually need to watch network directories so I'm obviously concerned I'm missing something. Do you think it's a timing thing? Seems like the watched dependency is never broken on unwatch. |
It seems like I have the same issue on OS X 10.10.3, io.js v1.5.1. var CHOKIDAR_OPTIONS = {
ignoreInitial: true,
cwd: process.cwd(),
ignorePermissionErrors: true
}; Then I use code like this to watch a directory. var watcher = chokidar.watch(
'local/relative/directory', CHOKIDAR_OPTIONS
); After some events I "unwatch" the directory like this: watcher.unwatch('local/relative/directory'); But when I remove the directory after I have called |
I pass by to say that unwatch doesn't work to me in windows 7 neither... |
Unwatch is not functioning for me either. |
Hello, is this still an issue? Just by reading the source code it appears that the unwatch function calls other functions that uses promises making it an async method, but at the same time the so if you write currentWatcher.unwatch(['tmp','tmp2','tmp3']);
currentWatcher.close(); the actual order of execution is currentWatcher.close(); // the part that sets this.closed = true at least
currentWatcher.unwatch(['tmp','tmp2','tmp3']); hence the unwatch method doesn't fire off. Am I right? I want to use this library in a project but I am concerned about this possible bug It has been resolved? It is still a thing? Thanks |
@flasaracina use |
@paulmillr Thanks for your quick response! Anyway, I was concerned with the bug the OP experienced concerning the unwatch method. If it is not a thing anymore I will be more than happy to start using chokidar right now. Keep up the good work! |
I'm using chokidar on Windows 7. Installed latest version today 1.3.11
I have a long-running node process that needs to watch and unwatch different folders daily. I successfully watch a collection of folders with all proper events. However, when I try to UNWATCH folders and then WATCH new folders, the old folders (now, presumably UNWATCHED) still generate notifications. The test I currently use is to UNWATCH/WATCH after 30 seconds. When I use watch.close() I (obviously) receive NO notifications. Can someone tell what I may be missing?
Thanks.
Any activity on folders ['tmp','tmp2','tmp3'] is still tracked, which I do not want nor expect.
The text was updated successfully, but these errors were encountered: