stream-slice: fix percentage calculation

This commit is contained in:
Starbeamrainbowlabs 2020-07-02 17:19:27 +01:00
parent 071e46abb0
commit 80dbe4696e
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 5 additions and 2 deletions

View File

@ -41,8 +41,11 @@ export default async function(settings) {
let is_last = i - offset >= count;
await next.serialise(stream_out, is_last);
let percentage = percentage(i - offset, count);
process.stderr.write(`Written ${i - offset} / count objects (~${count.toFixed(2)}%) \r`);
if(is_last) break;
process.stderr.write(`Written ${i - offset} / count objects (~${percentage(i - offset, count).toFixed(2)}%) \r`);
}
l.log(`Slicing complete`);
stream_in.close();
}