test: code cleanup
[poolifier.git] / src / pools / selection-strategies / round-robin-worker-choice-strategy.ts
index 7968e621d49df510c06ad2bd4899b56770b3b163..6884a5d277b87892daeb4d8acaba99bc510c671a 100644 (file)
@@ -32,7 +32,7 @@ export class RoundRobinWorkerChoiceStrategy<
 
   /** @inheritDoc */
   public reset (): boolean {
-    this.nextWorkerNodeKey = 0
+    this.resetWorkerNodeKeyProperties()
     return true
   }
 
@@ -44,8 +44,8 @@ export class RoundRobinWorkerChoiceStrategy<
   /** @inheritDoc */
   public choose (): number | undefined {
     const chosenWorkerNodeKey = this.nextWorkerNodeKey
+    this.setPreviousWorkerNodeKey(chosenWorkerNodeKey)
     this.roundRobinNextWorkerNodeKey()
-    this.checkNextWorkerNodeEligibility(chosenWorkerNodeKey)
     return chosenWorkerNodeKey
   }