From b7e939bbdde49d5df7283bed1e006c944ce3b326 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 20 Jan 2016 15:00:59 -0800 Subject: [PATCH] Adjust console logs for deleting old files --- server-console/src/main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index 34c1d82cf6..2576ac4cd3 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -162,7 +162,7 @@ function deleteOldFiles(directoryPath, maxAgeInSeconds, filenameRegex) { } for (const filename of filenames) { - console.log(filename); + console.log("Checking", filename); const absolutePath = path.join(directoryPath, filename); var stat = null; try { @@ -174,9 +174,8 @@ function deleteOldFiles(directoryPath, maxAgeInSeconds, filenameRegex) { const curTime = Date.now(); if (stat.isFile() && filename.search(filenameRegex) >= 0) { const ageInSeconds = (curTime - stat.mtime.getTime()) / 1000.0; - console.log("Match:", filename, ageInSeconds); if (ageInSeconds >= maxAgeInSeconds) { - console.log("\tDeleting:", filename); + console.log("\tDeleting:", filename, ageInSeconds); try { fs.unlinkSync(absolutePath); } catch (e) {