Skip to content

Commit

Permalink
Only shutdown if we're not already doing so
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Nov 19, 2024
1 parent 5190bb6 commit b6b1bc0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,11 @@ export function _runTaskList(
}
workerPool._workers.splice(workerPool._workers.indexOf(worker), 1);
if (!continuous && workerPool._workers.length === 0) {
workerPool.gracefulShutdown(
"'Run once' mode processed all available jobs and is now exiting",
);
if (!workerPool._shuttingDown) {
workerPool.gracefulShutdown(
"'Run once' mode processed all available jobs and is now exiting",
);
}
}
};
worker.promise.then(
Expand Down

0 comments on commit b6b1bc0

Please sign in to comment.