Use common getTotalCacheSize for TRAP caching
This commit is contained in:
parent
0cb71294e5
commit
21e6a62b15
9 changed files with 9 additions and 28 deletions
5
lib/trap-caching.js
generated
5
lib/trap-caching.js
generated
|
|
@ -27,7 +27,6 @@ exports.downloadTrapCaches = downloadTrapCaches;
|
|||
exports.uploadTrapCaches = uploadTrapCaches;
|
||||
exports.cleanupTrapCaches = cleanupTrapCaches;
|
||||
exports.getLanguagesSupportingCaching = getLanguagesSupportingCaching;
|
||||
exports.getTotalCacheSize = getTotalCacheSize;
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const actionsCache = __importStar(require("@actions/cache"));
|
||||
|
|
@ -227,10 +226,6 @@ async function getLanguagesSupportingCaching(codeql, languages, logger) {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
async function getTotalCacheSize(trapCaches, logger) {
|
||||
const sizes = await Promise.all(Object.values(trapCaches).map((cacheDir) => (0, util_1.tryGetFolderBytes)(cacheDir, logger)));
|
||||
return sizes.map((a) => a || 0).reduce((a, b) => a + b, 0);
|
||||
}
|
||||
async function cacheKey(codeql, language, baseSha) {
|
||||
return `${await cachePrefix(codeql, language)}${baseSha}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue