mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-12 11:14:00 +00:00
Merge pull request #8687 from overleaf/bg-validate-migration-updates
[web] validate updates in history migration GitOrigin-RevId: 35e11417ff83db81ad1dfd29165577e142e64f74
This commit is contained in:
parent
5c94bd81e7
commit
be71ea690d
1 changed files with 3 additions and 0 deletions
|
@ -9,6 +9,8 @@ const MAX_UPGRADES_TO_ATTEMPT =
|
||||||
parseInt(process.env.MAX_UPGRADES_TO_ATTEMPT, 10) || false
|
parseInt(process.env.MAX_UPGRADES_TO_ATTEMPT, 10) || false
|
||||||
const MAX_FAILURES = parseInt(process.env.MAX_FAILURES, 10) || 50
|
const MAX_FAILURES = parseInt(process.env.MAX_FAILURES, 10) || 50
|
||||||
const ARCHIVE_ON_FAILURE = process.env.ARCHIVE_ON_FAILURE === 'true'
|
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
|
// persist fallback in order to keep batchedUpdate in-sync
|
||||||
process.env.BATCH_SIZE = BATCH_SIZE
|
process.env.BATCH_SIZE = BATCH_SIZE
|
||||||
// raise mongo timeout to 1hr if otherwise unspecified
|
// raise mongo timeout to 1hr if otherwise unspecified
|
||||||
|
@ -130,6 +132,7 @@ async function doUpgradeForNoneWithConversion(project) {
|
||||||
}
|
}
|
||||||
await ProjectHistoryController.migrateProjectHistory(projectIdString, {
|
await ProjectHistoryController.migrateProjectHistory(projectIdString, {
|
||||||
archiveOnFailure: ARCHIVE_ON_FAILURE,
|
archiveOnFailure: ARCHIVE_ON_FAILURE,
|
||||||
|
fixInvalidCharacters: FIX_INVALID_CHARACTERS,
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// if migrateProjectHistory fails, it cleans up by deleting
|
// if migrateProjectHistory fails, it cleans up by deleting
|
||||||
|
|
Loading…
Reference in a new issue