From 05ca3d0dda373dd18120487f7517d80051b8e38f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 18 Apr 2023 23:29:05 +0200 Subject: [PATCH] fix: fix getWorkerTasksUsage() return type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 47378980..e0feb5ed 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -387,7 +387,7 @@ export abstract class AbstractPool< worker: Worker, message: MessageValue ): void { - const workerTasksUsage = this.getWorkerTasksUsage(worker) as TasksUsage + const workerTasksUsage = this.getWorkerTasksUsage(worker) --workerTasksUsage.running ++workerTasksUsage.run if (message.error != null) { @@ -560,7 +560,7 @@ export abstract class AbstractPool< * @throws Error if the worker is not found in the pool worker nodes. * @returns The worker tasks usage. */ - private getWorkerTasksUsage (worker: Worker): TasksUsage | undefined { + private getWorkerTasksUsage (worker: Worker): TasksUsage { const workerNodeKey = this.getWorkerNodeKey(worker) if (workerNodeKey !== -1) { return this.workerNodes[workerNodeKey].tasksUsage -- 2.34.1