Allow warnings in tryGetFolderBytes to be suppressed
To avoid confusing run annotations when dependency caching is enabled
This commit is contained in:
parent
b0c0aadc56
commit
7bc6222c12
9 changed files with 25 additions and 11 deletions
5
lib/caching-utils.js
generated
5
lib/caching-utils.js
generated
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue