From ebb7729fd08b81370905ad32e953d22c1dee80a4 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Tue, 13 Dec 2016 20:12:17 -0500 Subject: [PATCH] log total files to delete --- server/utils/db_reformat.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/utils/db_reformat.js b/server/utils/db_reformat.js index f591fd13..8d85da0e 100644 --- a/server/utils/db_reformat.js +++ b/server/utils/db_reformat.js @@ -49,14 +49,18 @@ objectsResponse.on('data', function(objects) { }); }); +const filesToDelete = []; objectsResponse.on('end', () => { console.log(uploadedFiles.length); uploadedFiles.forEach(fileKey => { if (s3Files.indexOf(fileKey) === -1) { //delete file - console.log("would delete file: ", fileKey); + filesToDelete.push(fileKey); + // console.log("would delete file: ", fileKey); } }); + console.log("To delete: ", filesToDelete.length); + console.log("Total S3 files: ", uploadedFiles.length); }); // let projectsNotToUpdate;