Skip to content

Commit

Permalink
fix: trigger end of progress bar only after finish event was triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Oct 30, 2023
1 parent fa92520 commit e57b9a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/_index-reader.js
Expand Up @@ -81,7 +81,6 @@ export default function indexReaderFactory(
// console.log('check count', response.hits.total.value, docsNum);
if (response.hits.total.value === docsNum) {
indexer.finish();
progressBar.stop();
break;
}

Expand Down Expand Up @@ -122,6 +121,10 @@ export default function indexReaderFactory(
processResponseQueue();
});

indexer.queueEmitter.on('finish', () => {
progressBar.stop();
});

processResponseQueue();
};
}

0 comments on commit e57b9a0

Please sign in to comment.