worker: Worker,
message: MessageValue<Response>
): void {
- const workerTasksUsage = this.getWorkerTasksUsage(worker) as TasksUsage
+ const workerTasksUsage = this.getWorkerTasksUsage(worker)
--workerTasksUsage.running
++workerTasksUsage.run
if (message.error != null) {
* @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