Skip to content

Commit

Permalink
remove unnecessary asyncMap
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-f committed Sep 9, 2022
1 parent 0472122 commit eca6244
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions @xen-orchestra/backups/RemoteAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,19 @@ class RemoteAdapter {
}

#removeVmBackupsFromCache(backups) {
// will not throw
asyncMap(
Object.entries(
groupBy(
backups.map(_ => _._filename),
dirname
)
),
([dir, filenames]) =>
this.#updateCache(dir + '/cache.json.gz', backups => {
for (const filename of filenames) {
delete backups[filename]
}
})
)
for (const [dir, filenames] of Object.entries(
groupBy(
backups.map(_ => _._filename),
dirname
)
)) {
// detached async action, will not reject
this.#updateCache(dir + '/cache.json.gz', backups => {
for (const filename of filenames) {
delete backups[filename]
}
})
}
}

async deleteDeltaVmBackups(backups) {
Expand Down

0 comments on commit eca6244

Please sign in to comment.