Merge branch 'master' of github.com:poolifier/poolifier
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index 8c5a9587debbd4b66fba9a7630838fcc44cabc3c..a3e3379c9ac461fc7cd16c2d32bb8735ca2d50ff 100644 (file)
@@ -183,8 +183,11 @@ export class WorkerChoiceStrategyContext<
       this.choiceRetriesCount++
       return this.execute()
     } else if (workerNodeKey == null) {
-      throw new TypeError('Worker node key chosen is null or undefined')
+      throw new TypeError(
+        `Worker node key chosen is null or undefined after ${this.choiceRetriesCount} retries`
+      )
     }
+    this.choiceRetriesCount = 0
     return workerNodeKey
   }