From b2ee44a6c2e5caaa1a8b76181bde8aa728d524de Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Tue, 26 Dec 2017 22:23:45 -0500 Subject: [PATCH] only save files that need to be saved --- server/migrations/moveBucket.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/migrations/moveBucket.js b/server/migrations/moveBucket.js index 69dc2c56..67a0a92d 100644 --- a/server/migrations/moveBucket.js +++ b/server/migrations/moveBucket.js @@ -35,10 +35,10 @@ Project.count({}) project.files.forEach(async (file, fileIndex) => { if (file.url && file.url.includes('p5.js-webeditor')) { file.url = file.url.replace('p5.js-webeditor', process.env.S3_BUCKET); + let savedProject = await project.save(); + console.log(`updated file ${file.url}`); + process.exit(0); } - let savedProject = await project.save(); - console.log(`updated file ${file.url}`); - process.exit(0); }); }); }