Allow warnings in tryGetFolderBytes to be suppressed

To avoid confusing run annotations when dependency caching is enabled
This commit is contained in:
Michael B. Gale 2024-11-12 15:16:18 +00:00
parent b0c0aadc56
commit 7bc6222c12
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
9 changed files with 25 additions and 11 deletions

5
lib/caching-utils.js generated
View file

@ -37,10 +37,11 @@ const util_1 = require("./util");
* Returns the total size of all the specified paths.
* @param paths The paths for which to calculate the total size.
* @param logger A logger to record some informational messages to.
* @param quiet A value indicating whether to suppress logging warnings (default: false).
* @returns The total size of all specified paths.
*/
async function getTotalCacheSize(paths, logger) {
const sizes = await Promise.all(paths.map((cacheDir) => (0, util_1.tryGetFolderBytes)(cacheDir, logger)));
async function getTotalCacheSize(paths, logger, quiet = false) {
const sizes = await Promise.all(paths.map((cacheDir) => (0, util_1.tryGetFolderBytes)(cacheDir, logger, quiet)));
return sizes.map((a) => a || 0).reduce((a, b) => a + b, 0);
}
/* Enumerates caching modes. */