Merge pull request #11629 from overleaf/msm-exit-migrate-history

[web/scripts] force exit on `migrate_history.js`

GitOrigin-RevId: 298568043c2885b8ad2c6242e7519faccf2f2498
This commit is contained in:
Miguel Serrano 2023-02-02 16:12:40 +01:00 committed by Copybot
parent 8d1ea82ad3
commit df3aff9c66

View file

@ -100,11 +100,7 @@ async function migrateProjects(projectsToMigrate) {
console.error(err)
}
}
console.log('Migration complete')
console.log('==================')
console.log('Projects migrated: ', projectsMigrated)
console.log('Projects failed: ', projectsFailed)
return { projectsMigrated, projectsFailed }
}
async function main() {
@ -113,8 +109,15 @@ async function main() {
console.log('Dry run, exiting')
process.exit(0)
}
await migrateProjects(projectsToMigrate)
const { projectsMigrated, projectsFailed } = await migrateProjects(
projectsToMigrate
)
console.log('Migration complete')
console.log('==================')
console.log('Projects migrated: ', projectsMigrated)
console.log('Projects failed: ', projectsFailed)
console.log('Done.')
process.exit(projectsFailed > 0 ? 1 : 0)
}
waitForDb()