Merge pull request #2164 from poolifier/dependabot/npm_and_yarn/tatami-ng-0.3.0
[poolifier.git] / src / pools / selection-strategies / interleaved-weighted-round-robin-worker-choice-strategy.ts
index 97a3aa04e5b941a31a053c53bf3f4416d15855f0..b1abe98772d88ce295b17aa6be653a332dd11b04 100644 (file)
@@ -1,6 +1,6 @@
-import type { IWorker } from '../worker.js'
 import type { IPool } from '../pool.js'
-import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../../utils.js'
+import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../utils.js'
+import type { IWorker } from '../worker.js'
 import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.js'
 import type {
   IWorkerChoiceStrategy,
@@ -133,7 +133,10 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
   /** @inheritDoc */
   public remove (workerNodeKey: number): boolean {
     if (this.pool.workerNodes.length === 0) {
-      this.reset()
+      this.resetWorkerNodeKeyProperties()
+      this.workerNodeId = 0
+      this.workerNodeVirtualTaskRunTime = 0
+      return true
     }
     if (
       this.workerNodeId === workerNodeKey &&