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

Replace blocking fs.readFileSync with non blocking fs.readFile in checkForChanges.js #5791

Merged
merged 1 commit into from Feb 7, 2019

Conversation

Projects
2 participants
@danielcondemarin
Copy link
Contributor

danielcondemarin commented Feb 4, 2019

What did you implement:

Closes: N/A

This PR implements a TODO that was left in checkForChanges.js > checkIfDeploymentIsNecessary which makes reading the zipFiles asynchronously, therefore should make checkForChanges run a bit faster, specially considering there is already a costly blocking operation after the read to compute the checksum per zipFile.

How did you implement it:

Simply replaced blocking fs.readFileSync with non blocking fs.readFile.

How can we verify it:

N/A

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@danielcondemarin danielcondemarin changed the title Read files before hashing asynchronously on checkIfDeploymentIsNecessary replace blocking fs.readFileSync with non blocking fs.readFile on checkForChanges Feb 4, 2019

@danielcondemarin danielcondemarin changed the title replace blocking fs.readFileSync with non blocking fs.readFile on checkForChanges replace blocking fs.readFileSync with non blocking fs.readFile in checkForChanges.js Feb 4, 2019

@pmuens pmuens self-assigned this Feb 5, 2019

@pmuens pmuens added the pr/in-review label Feb 5, 2019

@pmuens pmuens added this to In progress in Serverless via automation Feb 5, 2019

Serverless automation moved this from In progress to Reviewer approved Feb 5, 2019

@pmuens

pmuens approved these changes Feb 5, 2019

Copy link
Member

pmuens left a comment

Thanks for fixing this @danielcondemarin 👍

Just tested it and it works fine --> LGTM :shipit:

@pmuens pmuens changed the title replace blocking fs.readFileSync with non blocking fs.readFile in checkForChanges.js Replace blocking fs.readFileSync with non blocking fs.readFile in checkForChanges.js Feb 5, 2019

@pmuens pmuens merged commit bc9cb08 into serverless:master Feb 7, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Serverless automation moved this from Reviewer approved to Done Feb 7, 2019

@pmuens pmuens added this to the 1.38.0 milestone Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.