Merge pull request #11270 from overleaf/jpa-retry-translations-upload

[web] scripts: add retry to translations upload script

GitOrigin-RevId: b67af0def876d5e1dd0478e7b8fcd234bfc05447
This commit is contained in:
Jakob Ackermann 2023-01-16 12:01:37 +00:00 committed by Copybot
parent 95bb5ca4e4
commit dea52fec6f

View file

@ -40,11 +40,24 @@ async function pollUploadStatus(importId) {
}
}
async function main() {
async function uploadOnce() {
const importId = await uploadLocales()
await pollUploadStatus(importId)
}
async function main() {
try {
await uploadOnce()
} catch (err) {
console.error('--- upload failed once ---')
console.error(err)
console.error('--- upload failed once ---')
console.log('retrying upload in 30s')
await sleep(30_000)
await uploadOnce()
}
}
main().catch(error => {
console.error({ error })
process.exit(1)