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 cliProgress = require('cli-progress');
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
class IpfsPinner {
|
||||
constructor (kredits, options={}) {
|
||||
this.kredits = kredits;
|
||||
|
@ -46,6 +50,9 @@ class IpfsPinner {
|
|||
|
||||
await Promise.all(promises);
|
||||
|
||||
// Avoid console output race condition with progress bars finishing update
|
||||
if (this.progressBars) await sleep(1000);
|
||||
|
||||
return cids;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue