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

fix: wait for chokidar ready event before listening to function builder src directory #974

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

erezrokah
Copy link
Contributor

@erezrokah erezrokah commented Jul 1, 2020

- Summary

Fixes #904

- Test plan

You can follow my comment here to reproduce

- Description for the changelog

chokidar sends an initial add event for each existing file in the watched directory.
In the case of the bug, that event was fired for each file under functions/node_modules spawning multiple build commands.

You can ignore those initial events by waiting for the ready event or passing ignoreInitial:
https://github.com/paulmillr/chokidar#path-filtering

Also debounced the build command to make sure only one instance of it executes at a single point in time.

- A picture of a cute animal (not mandatory but encouraged)

🐈

@erezrokah erezrokah added the type: bug code to address defects in shipped code label Jul 1, 2020
Copy link
Contributor

@RaeesBhatti RaeesBhatti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erezrokah erezrokah merged commit 99cf506 into master Jul 2, 2020
@erezrokah erezrokah deleted the fix/function_builder_watch branch July 2, 2020 15:49
@RaeesBhatti
Copy link
Contributor

Thank you for this PR @erezrokah

@erezrokah
Copy link
Contributor Author

My pleasure 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

netlify dev opens up node instances seemingly recursively until PC is shut down.
2 participants