Skip to content

Commit

Permalink
refactor(cache): use rm.content to remove expired content (#29860)
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Jun 26, 2024
1 parent 98e089b commit a829d96
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/util/cache/package/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ export async function cleanup(): Promise<void> {
DateTime.local() > DateTime.fromISO(cachedValue.expiry))
) {
await cacache.rm.entry(cacheFileName, cachedItem.key);
await cacache.rm.content(cacheFileName, cachedItem.integrity);
deletedCount += 1;
}
}
logger.debug(`Verifying and cleaning cache: ${cacheFileName}`);
await cacache.verify(cacheFileName);
const durationMs = Math.round(Date.now() - startTime);
logger.debug(
`Deleted ${deletedCount} of ${totalCount} file cached entries in ${durationMs}ms`,
Expand Down

0 comments on commit a829d96

Please sign in to comment.