Skip to content

Commit

Permalink
Use allSettled
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Mar 9, 2022
1 parent 1e8da5c commit f6daeab
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions components/server/src/code-sync/code-sync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,8 @@ export class CodeSyncService {
}
oldRevList = oldRevs
}, { latestRev, revLimit });
// delete old revs from storage
this.deleteObjects(userId, resourceKey, oldRevList).catch(e => {
// just in case
log.error({ userId }, 'code sync: failed to delete while insert', e);
})
// sync delete old revs from storage
this.deleteObjects(userId, resourceKey, oldRevList)
if (!rev) {
res.sendStatus(412);
return;
Expand Down Expand Up @@ -311,7 +308,7 @@ export class CodeSyncService {
}).catch(err => {
log.error({ userId }, 'code sync: failed to delete', err);
}))
return Promise.all(tasks)
return Promise.allSettled(tasks)
}

}

0 comments on commit f6daeab

Please sign in to comment.