Skip to content

Conversation

alan-agius4
Copy link
Collaborator

With every build-angular release, previously created cache entries get stale and are no longer used. This causes the cache to keep growing as older files are not purged.

With this change we automatically purge entries that have been created with older version of build-angular and can no longer be used with the current installed version.

Closes #22323

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Jan 11, 2022
@alan-agius4 alan-agius4 requested a review from dgp1130 January 11, 2022 09:24
@alan-agius4 alan-agius4 changed the title fix(@angular-devkit/build-angular): automatically purge stale build entries fix(@angular-devkit/build-angular): automatically purge stale build cache entries Jan 11, 2022
} else {
await rmdir(entryPath, { recursive: true, maxRetries: 3 });
}
} catch {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like I just saw this snippet in another PR, is this a common pattern in the CLI? Would it be worth factoring this out to something reusable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I can do that once both PRs are merged.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually the other PR is using the sync version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Up to you whether it's worth merging them, just something I noticed looking through it.

@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jan 12, 2022
…ache entries

With every build-angular release, previously created cache entries get stale and are no longer used. This causes the cache to keep growing as older files are not purged.

With this change we automatically purge entries that have been created with older version of build-angular and can no longer be used with the current installed version.

Closes #22323
@dgp1130 dgp1130 merged commit 6d2087b into angular:master Jan 12, 2022
@alan-agius4 alan-agius4 deleted the cache-purge branch January 12, 2022 17:59
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular cache dir (.angular) grows and grows
2 participants