From ba443f407e3d94f83bb8d013f7552b271bd3d445 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 28 Aug 2024 00:21:24 +0200 Subject: [PATCH] refactor: cleanup pool information ordering MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 6 +++--- src/worker/abstract-worker.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 2cf21126..35ac4a0f 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -2044,6 +2044,9 @@ export abstract class AbstractPool< minSize: this.minimumNumberOfWorkers, ready: this.ready, started: this.started, + ...(this.opts.enableTasksQueue === true && { + backPressure: this.backPressure, + }), strategyRetries: this.workerChoiceStrategiesContext?.retriesCount ?? 0, type: this.type, version, @@ -2108,9 +2111,6 @@ export abstract class AbstractPool< 0 ), }), - ...(this.opts.enableTasksQueue === true && { - backPressure: this.backPressure, - }), ...(this.opts.enableTasksQueue === true && { stolenTasks: this.workerNodes.reduce( (accumulator, workerNode) => diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 24a4b01f..57f64171 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -292,7 +292,6 @@ export abstract class AbstractWorker< case 'remove': response = this.removeTaskFunction(taskFunctionProperties.name) break - default: response = { error: new Error('Unknown task operation'), status: false } break -- 2.34.1