From cefdc78c6e2a1c5422652b4eb4f0ec29186e9edb Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Tue, 31 Jan 2023 11:30:21 +0100 Subject: [PATCH] Merge pull request #11550 from overleaf/msm-migrate-history-count-fix [web/scripts] fix error count in `migrate_history.js` GitOrigin-RevId: d7326c4e25913969f196276c913e70a03398f3ac --- services/web/scripts/history/migrate_history.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/web/scripts/history/migrate_history.js b/services/web/scripts/history/migrate_history.js index 9d30704f14..a38ac79dfb 100644 --- a/services/web/scripts/history/migrate_history.js +++ b/services/web/scripts/history/migrate_history.js @@ -88,8 +88,13 @@ async function migrateProjects(projectsToMigrate) { console.log(`Migrating project: ${project._id}`) try { const result = await upgradeProject(project._id) - console.log('migration result', result) - projectsMigrated++ + if (result.error) { + console.error('migration failed', result) + projectsFailed++ + } else { + console.log('migration result', result) + projectsMigrated++ + } } catch (err) { projectsFailed++ console.error(err)