From a829d96891ef28df1a5242bca83ba9933168d6d6 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Wed, 26 Jun 2024 16:30:14 +0530 Subject: [PATCH] refactor(cache): use `rm.content` to remove expired content (#29860) --- lib/util/cache/package/file.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/util/cache/package/file.ts b/lib/util/cache/package/file.ts index b5b384ad03fad4..a244987c178f9f 100644 --- a/lib/util/cache/package/file.ts +++ b/lib/util/cache/package/file.ts @@ -96,11 +96,10 @@ export async function cleanup(): Promise { 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`,