Address review comments from @henrymercer
This commit is contained in:
parent
4139682b64
commit
b29194f0ac
12 changed files with 95 additions and 58 deletions
11
lib/trap-caching.js
generated
11
lib/trap-caching.js
generated
|
|
@ -159,14 +159,17 @@ async function getLanguagesSupportingCaching(codeql, languages, logger) {
|
|||
return result;
|
||||
}
|
||||
exports.getLanguagesSupportingCaching = getLanguagesSupportingCaching;
|
||||
async function getTotalCacheSize(trapCaches) {
|
||||
async function getTotalCacheSize(trapCaches, logger) {
|
||||
const sizes = await Promise.all(Object.values(trapCaches).map(async (cacheDir) => {
|
||||
return new Promise((resolve) => {
|
||||
(0, get_folder_size_1.default)(cacheDir, (err, size) => {
|
||||
// Ignore file system errors when getting the size. It's only used for telemetry anyway.
|
||||
if (err)
|
||||
if (err) {
|
||||
logger.warning(`Error getting size of ${cacheDir}: ${err}`);
|
||||
resolve(0);
|
||||
resolve(size);
|
||||
}
|
||||
else {
|
||||
resolve(size);
|
||||
}
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue