mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user