From be71ea690dfe82ad90115441cbd292d825057249 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 4 Jul 2022 11:03:52 +0100 Subject: [PATCH] Merge pull request #8687 from overleaf/bg-validate-migration-updates [web] validate updates in history migration GitOrigin-RevId: 35e11417ff83db81ad1dfd29165577e142e64f74 --- .../history/upgrade_none_with_conversion_if_sl_history.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/web/scripts/history/upgrade_none_with_conversion_if_sl_history.js b/services/web/scripts/history/upgrade_none_with_conversion_if_sl_history.js index e059a6fbee..a05e4bc386 100644 --- a/services/web/scripts/history/upgrade_none_with_conversion_if_sl_history.js +++ b/services/web/scripts/history/upgrade_none_with_conversion_if_sl_history.js @@ -9,6 +9,8 @@ const MAX_UPGRADES_TO_ATTEMPT = parseInt(process.env.MAX_UPGRADES_TO_ATTEMPT, 10) || false const MAX_FAILURES = parseInt(process.env.MAX_FAILURES, 10) || 50 const ARCHIVE_ON_FAILURE = process.env.ARCHIVE_ON_FAILURE === 'true' +const FIX_INVALID_CHARACTERS = process.env.FIX_INVALID_CHARACTERS === 'true' + // persist fallback in order to keep batchedUpdate in-sync process.env.BATCH_SIZE = BATCH_SIZE // raise mongo timeout to 1hr if otherwise unspecified @@ -130,6 +132,7 @@ async function doUpgradeForNoneWithConversion(project) { } await ProjectHistoryController.migrateProjectHistory(projectIdString, { archiveOnFailure: ARCHIVE_ON_FAILURE, + fixInvalidCharacters: FIX_INVALID_CHARACTERS, }) } catch (err) { // if migrateProjectHistory fails, it cleans up by deleting