backup size: display stats correctly

This commit is contained in:
Girish Ramakrishnan
2025-10-01 17:19:58 +02:00
parent f69bdd1ac4
commit 832eca2d9c
5 changed files with 29 additions and 13 deletions

View File

@@ -169,12 +169,14 @@ async function tarPack(dataLayout, encryption, uploader, progressCallback) {
const [error] = await pipeline; // already wrapped in safe()
if (error) throw new BoxError(BoxError.EXTERNAL_ERROR, `tarPack pipeline error: ${error.message}`);
debug(`tarPack: pipeline finished: ${JSON.stringify(ps.stats())}`);
const stats = ps.stats();
debug(`tarPack: pipeline finished: ${JSON.stringify(stats)}`);
await uploader.finish();
return {
stats: { fileCount, ...ps.stats() },
integrity: { size: ps.stats().transferred, fileCount, sha256: hash.digest('hex') }
stats: { fileCount, size: stats.transferred, ...stats },
integrity: { size: stats.transferred, fileCount, sha256: hash.digest('hex') }
};
}