From b6b1bc01cbe94f5c9fa03ce1a65f267bcaf33587 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 19 Nov 2024 18:02:43 +0000 Subject: [PATCH] Only shutdown if we're not already doing so --- src/main.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index d98497f7..8f92119f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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(