refactor: cleanup updateTaskStolenStatisticsWorkerUsage() signature
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 28 Aug 2023 03:15:32 +0000 (05:15 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 28 Aug 2023 03:15:32 +0000 (05:15 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index 5aadac8127cceb68c313a57b0df2d16332953a79..a41996ff918d527d2ef81ac29f431cdd601b91c7 100644 (file)
@@ -1230,9 +1230,9 @@ export abstract class AbstractPool<
 
   private updateTaskStolenStatisticsWorkerUsage (
     workerNodeKey: number,
-    workerNode: IWorkerNode<Worker, Data>,
     taskName: string
   ): void {
+    const workerNode = this.workerNodes[workerNodeKey]
     if (workerNode?.usage != null) {
       ++workerNode.usage.tasks.stolen
     }
@@ -1276,7 +1276,6 @@ export abstract class AbstractPool<
         }
         this.updateTaskStolenStatisticsWorkerUsage(
           destinationWorkerNodeKey,
-          destinationWorkerNode,
           task.name as string
         )
         break
@@ -1315,7 +1314,6 @@ export abstract class AbstractPool<
         }
         this.updateTaskStolenStatisticsWorkerUsage(
           workerNodeKey,
-          workerNode,
           task.name as string
         )
       }