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

Don't mutate the original options #126

Merged
merged 1 commit into from
Feb 17, 2017

Conversation

jbunton-atlassian
Copy link
Contributor

A bug was introduced by #113.

If you watch multiple directories then the same options object is passed from CLI to watchTree multiple times. watchTree mutates the options.interval each time. This results in the actual interval becoming 1000x higher that it should for two directories, 1000000x for three and so on.

The best fix is to pass a new options object to fs.watchFile() which is calculated from the original.

@levithomason
Copy link
Collaborator

levithomason commented Feb 17, 2017

Yep, thank you. Released in watch@1.0.2.

@jbunton-atlassian
Copy link
Contributor Author

Awesome, thanks!

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