fix: fix dynamic thread pool full event emission rate
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 30 Aug 2024 10:18:16 +0000 (12:18 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 30 Aug 2024 10:18:16 +0000 (12:18 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/thread/dynamic.ts

index 34806edbde1321f217dd102ddf87fdea217d1773..086f8733cebe00c0398b3cb57308ff507960a564 100644 (file)
@@ -44,7 +44,7 @@ export class DynamicThreadPool<
 
   /** @inheritDoc */
   protected checkAndEmitDynamicWorkerCreationEvents (): void {
-    if (this.emitter != null && this.full) {
+    if (this.emitter != null && !this.fullEventEmitted && this.full) {
       this.emitter.emit(PoolEvents.full, this.info)
       this.fullEventEmitted = true
     }