From: Jérôme Benoit Date: Tue, 27 Aug 2024 22:21:24 +0000 (+0200) Subject: refactor: cleanup pool information ordering X-Git-Tag: v4.2.7~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ba443f407e3d94f83bb8d013f7552b271bd3d445;p=poolifier.git refactor: cleanup pool information ordering Signed-off-by: Jérôme Benoit --- 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