From: Jérôme Benoit Date: Sat, 19 Aug 2023 18:18:37 +0000 (+0200) Subject: refactor: cleanup worker usage statistics code X-Git-Tag: v2.6.31~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5623b8d539e054f846e86b1f8b3d2e60be748330;p=poolifier.git refactor: cleanup worker usage statistics code Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 428dd912..1aa1a134 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -819,10 +819,8 @@ export abstract class AbstractPool< const taskFunctionWorkerUsage = this.workerNodes[ workerNodeKey ].getTaskFunctionWorkerUsage(task.name as string) as WorkerUsage - if (taskFunctionWorkerUsage != null) { - ++taskFunctionWorkerUsage.tasks.executing - this.updateWaitTimeWorkerUsage(taskFunctionWorkerUsage, task) - } + ++taskFunctionWorkerUsage.tasks.executing + this.updateWaitTimeWorkerUsage(taskFunctionWorkerUsage, task) } } @@ -846,7 +844,7 @@ export abstract class AbstractPool< if ( this.shallUpdateTaskFunctionWorkerUsage(workerNodeKey) && this.workerNodes[workerNodeKey].getTaskFunctionWorkerUsage( - message.taskPerformance?.name ?? DEFAULT_TASK_NAME + message.taskPerformance?.name as string ) != null ) { const taskFunctionWorkerUsage = this.workerNodes[