Repository navigation
Conversation
…then-delete markForRemoval uses fs.renameSync so the directory vanishes in the same execution frame — no event-loop yield between call and rename completing. removePendingDir and scanPendingRemovals are async (background cleanup).
FrameworkCache now delegates its inline rename-then-delete and stale-dir scan logic to these helpers. Zero behavior change. Prepares the abstraction for reuse in build-cache older-version cleanup.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: CPOUI5FOUNDATION-1394
The framework cache clean uses an atomic rename-then-delete pattern: synchronously rename the directory so it disappears immediately, then asynchronously remove it — with the ability to resume if the process is killed in between. This logic is currently inlined in
FrameworkCache.This PR extracts it into a reusable
lib/utils/interruptibleRemoval.jshelper (markForRemoval,removePendingDir,scanPendingRemovals). No behavior changes —FrameworkCacheis simply wired to use the helper instead of its own inline copy.The motivation is: extending
ui5 cache cleanto remove all outdated build-cache version directories.Each build-cache version directory contains a single SQLite database (
cache.db). The current version's database is cleaned by dropping all tables and running a deferredVACUUM— an operation that is both fast and schema-aware. Older version directories might not be able to be opened with the currentBuildCacheStorage: the schema may change across versions, and attempting toDROP TABLEagainst an incompatible schema may produce a misleading "already performed by another process" error. Because the data in those directories is by definition stale and no longer readable by the current CLI, there is no reason to open them at all. Treating them as opaque filesystem directories and removing them with rename + rm is both simpler and safer.