Skip to content

Commit

Permalink
feat(xo-web): delete all the backups at once and let xo-server handle…
Browse files Browse the repository at this point in the history
… the cleanup
  • Loading branch information
fbeauchamp committed Jan 12, 2022
1 parent 31508cf commit bffb8b3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/xo-web/src/common/xo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2221,13 +2221,7 @@ export const restoreBackup = (backup, sr, { generateNewMacAddresses = false, sta

export const deleteBackup = backup => _call('backupNg.deleteVmBackup', { id: resolveId(backup) })

export const deleteBackups = async backups => {
// delete sequentially from newest to oldest
backups = backups.slice().sort((b1, b2) => b2.timestamp - b1.timestamp)
for (let i = 0, n = backups.length; i < n; ++i) {
await deleteBackup(backups[i])
}
}
export const deleteBackups = async backups => _call('backupNg.deleteVmBackups', { ids: backups.map(backup => resolveId(backup)) })

export const createMetadataBackupJob = props =>
_call('metadataBackup.createJob', props)
Expand Down

0 comments on commit bffb8b3

Please sign in to comment.