X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fworker-node.ts;h=ed6677027f810474aa9aa01e768fd5f483250679;hb=f4d1dbd1592e24d7a09f35013c3e0f0762240254;hp=68c8cab2ef97070ccea235dfd391ed5479978120;hpb=4735284627d276d3532cb3bd4b6d7fe392bb6b8b;p=poolifier.git diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 68c8cab2..ed667702 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -161,21 +161,21 @@ implements IWorkerNode { /** @inheritdoc */ public getTaskFunctionWorkerUsage (name: string): WorkerUsage | undefined { - if (!Array.isArray(this.info.taskFunctions)) { + if (!Array.isArray(this.info.taskFunctionNames)) { throw new Error( `Cannot get task function worker usage for task function name '${name}' when task function names list is not yet defined` ) } if ( - Array.isArray(this.info.taskFunctions) && - this.info.taskFunctions.length < 3 + Array.isArray(this.info.taskFunctionNames) && + this.info.taskFunctionNames.length < 3 ) { throw new Error( `Cannot get task function worker usage for task function name '${name}' when task function names list has less than 3 elements` ) } if (name === DEFAULT_TASK_NAME) { - name = this.info.taskFunctions[1] + name = this.info.taskFunctionNames[1] } if (!this.taskFunctionsUsage.has(name)) { this.taskFunctionsUsage.set(name, this.initTaskFunctionWorkerUsage(name)) @@ -249,7 +249,7 @@ implements IWorkerNode { for (const task of this.tasksQueue) { if ( (task.name === DEFAULT_TASK_NAME && - name === (this.info.taskFunctions as string[])[1]) || + name === (this.info.taskFunctionNames as string[])[1]) || (task.name !== DEFAULT_TASK_NAME && name === task.name) ) { ++taskFunctionQueueSize