Skip to content

Commit

Permalink
[INTERNAL] Ensure pool is viable before requesting stats
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Feb 27, 2024
1 parent 8778fe9 commit dc07fa1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tasks/buildThemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function getPool(taskUtil) {
let {idleWorkers, totalWorkers} = pool.stats();
while (idleWorkers !== totalWorkers && !force) {
await setTimeoutPromise(100); // Wait a bit workers to finish and try again
// Pool might be terminated during the break
if (!pool || !pool.stats) {
break;
}
({idleWorkers, totalWorkers} = pool.stats());
}

Expand Down

0 comments on commit dc07fa1

Please sign in to comment.