Merge pull request #7788 from overleaf/jpa-deletion-retries

[web] add retries to project archiver deletion

GitOrigin-RevId: 90097a057b1ed6224151ddfb7f5c7be4ed4b34c4
This commit is contained in:
June Kelly 2022-04-28 11:18:26 +01:00 committed by Copybot
parent 2f2369c74e
commit ebc24c5bf9

View file

@ -85,12 +85,20 @@ async function hardDeleteProjectArchiverData(prefix) {
console.log(`Destroying hard deleted project archive at '${prefix}/'`)
if (DRY_RUN) return
const ok = await TpdsUpdateSender.promises.deleteProject({
project_id: encodeURIComponent(prefix),
})
if (!ok) {
throw new Error(`deletion failed for '${prefix}/', check logs`)
for (let i = 0; i < 10; i++) {
await sleep(1000 * i)
try {
const ok = await TpdsUpdateSender.promises.deleteProject({
project_id: encodeURIComponent(prefix),
})
if (ok) {
return
}
} catch (e) {
console.error(`deletion failed for '${prefix}/'`, e)
}
}
throw new Error(`deletion failed for '${prefix}/', check logs`)
}
async function letUserDoubleCheckInputs() {