refactor: cleanup pool information ordering
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 27 Aug 2024 22:21:24 +0000 (00:21 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 27 Aug 2024 22:21:24 +0000 (00:21 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts
src/worker/abstract-worker.ts

index 2cf21126473cf44d548d7bcd6ee253cb2f4c8b06..35ac4a0f337d0859216f6082cec3deb2776d5a71 100644 (file)
@@ -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) =>
index 24a4b01fc39fb033cc989bfe95736cc53f3527a0..57f64171258208fd02799bf3f028dfaef79aa4b0 100644 (file)
@@ -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