Skip to content

Commit

Permalink
Renames
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Nov 10, 2023
1 parent 2f8181f commit b11a433
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/processors/minifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getPool(taskUtil) {
workerType: "auto",
maxWorkers
});
taskUtil.registerCleanupTask((forceTerminate) => {
taskUtil.registerCleanupTask((force) => {
const attemptPoolTermination = () => {
log.verbose(`Attempt to terminate the workerpool...`);

Expand All @@ -39,15 +39,15 @@ function getPool(taskUtil) {
// There are many stats that could be used, but these ones seem the most
// convenient. When all the (available) workers are idle, then it's safe to terminate.
const {idleWorkers, totalWorkers} = pool.stats();
if (idleWorkers !== totalWorkers && !forceTerminate) {
if (idleWorkers !== totalWorkers && !force) {
return new Promise((resolve) =>
setTimeout(() => resolve(attemptPoolTermination()), 100) // Retry after a while
);
}

const poolToBeTerminated = pool;
pool = null;
return poolToBeTerminated.terminate(forceTerminate);
return poolToBeTerminated.terminate(force);
};

return attemptPoolTermination();
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/buildThemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getPool(taskUtil) {
workerType: "thread",
maxWorkers
});
taskUtil.registerCleanupTask((forceTerminate) => {
taskUtil.registerCleanupTask((force) => {
const attemptPoolTermination = () => {
log.verbose(`Attempt to terminate the workerpool...`);

Expand All @@ -34,15 +34,15 @@ function getPool(taskUtil) {
// There are many stats that could be used, but these ones seem the most
// convenient. When all the (available) workers are idle, then it's safe to terminate.
const {idleWorkers, totalWorkers} = pool.stats();
if (idleWorkers !== totalWorkers && !forceTerminate) {
if (idleWorkers !== totalWorkers && !force) {
return new Promise((resolve) =>
setTimeout(() => resolve(attemptPoolTermination()), 100) // Retry after a while
);
}

const poolToBeTerminated = pool;
pool = null;
return poolToBeTerminated.terminate(forceTerminate);
return poolToBeTerminated.terminate(force);
};

return attemptPoolTermination();
Expand Down

0 comments on commit b11a433

Please sign in to comment.