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

refactor(@angular-devkit/schematics): avoid double file access reading JSON files #27928

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

clydin
Copy link
Member

@clydin clydin commented Jun 26, 2024

The file system engine hosts for schematics were using a helper method to read JSON files that was performing both an exist and read call. Besides causing two file system calls, this also has a potential race condition where the file may not exist by the time the read call is made. To avoid this, a try/catch is used with the read call to handle the not existing case.

…g JSON files

The file system engine hosts for schematics were using a helper method to
read JSON files that was performing both an exist and read call. Besides
causing two file system calls, this also has a potential race condition
where the file may not exist by the time the read call is made. To avoid
this, a try/catch is used with the read call to handle the not existing
case.
@clydin clydin added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 26, 2024
@clydin clydin requested a review from alan-agius4 June 26, 2024 01:41
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 26, 2024
@dgp1130 dgp1130 merged commit b60b7da into angular:main Jun 26, 2024
33 checks passed
@clydin clydin deleted the schematics/double-json-read branch June 26, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants