fix(xo-server/file restore): await addDirectory()

This commit is contained in:
Julien Fontanet 2018-08-23 13:47:30 +02:00
parent bacdc63c70
commit e3391fa81f

View File

@ -180,13 +180,15 @@ export default class BackupNgFileRestore {
$defer.onFailure(partition.unmount)
const zip = new ZipFile()
paths.forEach(file => {
addDirectory(
zip,
resolveSubpath(partition.path, file),
normalize('./' + file)
await Promise.all(
paths.map(file =>
addDirectory(
zip,
resolveSubpath(partition.path, file),
normalize('./' + file)
)
)
})
)
zip.end()
return zip.outputStream.on('end', () =>
partition.unmount().then(disk.unmount)