Fix progress bar rendering when finished
This commit is contained in:
parent
9dffb15f45
commit
03ee17f00e
@ -1,6 +1,10 @@
|
|||||||
const debug = require('debug')('ipfs-pinner');
|
const debug = require('debug')('ipfs-pinner');
|
||||||
const cliProgress = require('cli-progress');
|
const cliProgress = require('cli-progress');
|
||||||
|
|
||||||
|
function sleep(ms) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
|
||||||
class IpfsPinner {
|
class IpfsPinner {
|
||||||
constructor (kredits, options={}) {
|
constructor (kredits, options={}) {
|
||||||
this.kredits = kredits;
|
this.kredits = kredits;
|
||||||
@ -46,6 +50,9 @@ class IpfsPinner {
|
|||||||
|
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
|
|
||||||
|
// Avoid console output race condition with progress bars finishing update
|
||||||
|
if (this.progressBars) await sleep(1000);
|
||||||
|
|
||||||
return cids;
|
return cids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user