diff --git a/src/util/storage.ts b/src/util/storage.ts index b37f2aaf..2312cd90 100644 --- a/src/util/storage.ts +++ b/src/util/storage.ts @@ -208,6 +208,7 @@ export async function checkDiskUtilization( params: Record, archiveDirSize: number, dfOutput = null, + doLog = true, ) { const diskUsage: Record = await getDiskUsage( collDir, @@ -217,9 +218,11 @@ export async function checkDiskUtilization( // Check that disk usage isn't already above threshold if (usedPercentage >= params.diskUtilization) { - logger.info( - `Disk utilization threshold reached ${usedPercentage}% > ${params.diskUtilization}%, stopping`, - ); + if (doLog) { + logger.info( + `Disk utilization threshold reached ${usedPercentage}% > ${params.diskUtilization}%, stopping`, + ); + } return { stop: true, used: usedPercentage, @@ -246,9 +249,11 @@ export async function checkDiskUtilization( ); if (projectedUsedPercentage >= params.diskUtilization) { - logger.info( - `Disk utilization projected to reach threshold ${projectedUsedPercentage}% > ${params.diskUtilization}%, stopping`, - ); + if (doLog) { + logger.info( + `Disk utilization projected to reach threshold ${projectedUsedPercentage}% > ${params.diskUtilization}%, stopping`, + ); + } return { stop: true, used: usedPercentage, diff --git a/tests/adblockrules.test.js b/tests/adblockrules.test.js index 2d987a56..c10d1ac2 100644 --- a/tests/adblockrules.test.js +++ b/tests/adblockrules.test.js @@ -15,7 +15,7 @@ function runCrawl(name, config, commandExtra = "") { { input: configYaml, stdin: "inherit", encoding: "utf8" }, ); - console.log(proc); + //console.log(proc); } catch (error) { console.log(error); } diff --git a/tests/blockrules.test.js b/tests/blockrules.test.js index 0407ae0a..6f789907 100644 --- a/tests/blockrules.test.js +++ b/tests/blockrules.test.js @@ -15,7 +15,7 @@ function runCrawl(name, config, commandExtra = "") { { input: configYaml, stdin: "inherit", encoding: "utf8" }, ); - console.log(proc); + //console.log(proc); } catch (error) { console.log(error); } diff --git a/tests/config_stdin.test.js b/tests/config_stdin.test.js index b2f1194a..bf705b12 100644 --- a/tests/config_stdin.test.js +++ b/tests/config_stdin.test.js @@ -12,7 +12,7 @@ test("pass config file via stdin", async () => { { input: configYaml, stdin: "inherit", encoding: "utf8" }, ); - console.log(proc); + //console.log(proc); } catch (error) { console.log(error); } diff --git a/tests/rollover-writer.test.js b/tests/rollover-writer.test.js index f44d1de1..b7308483 100644 --- a/tests/rollover-writer.test.js +++ b/tests/rollover-writer.test.js @@ -11,8 +11,6 @@ test("set rollover to 500K and ensure individual WARCs rollover, including scree let main = 0; let screenshots = 0; - console.log(warcLists); - for (const name of warcLists) { if (name.startsWith("rec-")) { main++; diff --git a/tests/storage.test.js b/tests/storage.test.js index 215f22c4..310cb6ce 100644 --- a/tests/storage.test.js +++ b/tests/storage.test.js @@ -33,6 +33,7 @@ grpcfuse 1000000 285000 715000 28% /crawls`; params, 5000 * 1024, mockDfOutput, + false ); expect(returnValue).toEqual({ stop: false, @@ -60,6 +61,7 @@ grpcfuse 100000 85000 15000 85% /crawls`; params, 3000 * 1024, mockDfOutput, + false ); expect(returnValue).toEqual({ stop: true, diff --git a/tests/warcinfo.test.js b/tests/warcinfo.test.js index da24c448..3d98b899 100644 --- a/tests/warcinfo.test.js +++ b/tests/warcinfo.test.js @@ -13,7 +13,7 @@ test("run crawl", async() => { { input: configYaml, stdin: "inherit", encoding: "utf8" }, ); - console.log(proc); + //console.log(proc); success = true; } catch (error) { console.log(error);