]> Piment Noir Git Repositories - poolifier.git/commitdiff
refactor: cleanup task function ops method
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 8 Jul 2025 17:28:17 +0000 (19:28 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 8 Jul 2025 17:28:17 +0000 (19:28 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index 2d8255f92c03b4ff47c4fdb3fabd203dfdbb157d..088696b40d2bd76eb49a53f22407014bf801a4fe 100644 (file)
@@ -2316,9 +2316,9 @@ export abstract class AbstractPool<
     const taskFunctionOperationsListener = (
       message: MessageValue<Response>,
       resolve: (value: boolean | PromiseLike<boolean>) => void,
-      reject: (reason?: unknown) => void,
-      responsesReceived: MessageValue<Response>[]
+      reject: (reason?: unknown) => void
     ): void => {
+      const responsesReceived: MessageValue<Response>[] = []
       this.checkMessageWorkerId(message)
       if (
         message.taskFunctionOperationStatus != null &&
@@ -2351,14 +2351,8 @@ export abstract class AbstractPool<
     let listener: ((message: MessageValue<Response>) => void) | undefined
     try {
       return await new Promise<boolean>((resolve, reject) => {
-        const responsesReceived: MessageValue<Response>[] = []
         listener = (message: MessageValue<Response>) => {
-          taskFunctionOperationsListener(
-            message,
-            resolve,
-            reject,
-            responsesReceived
-          )
+          taskFunctionOperationsListener(message, resolve, reject)
         }
         for (const workerNodeKey of targetWorkerNodeKeys) {
           this.registerWorkerMessageListener(workerNodeKey, listener)