X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=e122e88180bce90a32710f0d8f6bd8537d57b8b9;hb=419e812146b183bb91e1b0e01199fbe5aa11f7d2;hp=6a26c7b7a63129c1d51e1bcfac0804b2d9962608;hpb=72ae84a2c9ccb043ce8b0ca2b83014d47a8120cb;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 6a26c7b7..e122e881 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -69,8 +69,7 @@ export abstract class AbstractPool< public readonly emitter?: PoolEmitter /** - * The task execution response promise map. - * + * The task execution response promise map: * - `key`: The message id of each submitted task. * - `value`: An object that contains the worker, the execution response promise resolve and reject callbacks. * @@ -722,14 +721,13 @@ export abstract class AbstractPool< (this.opts.tasksQueueOptions?.concurrency as number) ) === -1 ) - } else { - return ( - this.workerNodes.findIndex( - workerNode => - workerNode.info.ready && workerNode.usage.tasks.executing === 0 - ) === -1 - ) } + return ( + this.workerNodes.findIndex( + workerNode => + workerNode.info.ready && workerNode.usage.tasks.executing === 0 + ) === -1 + ) } private async sendTaskFunctionOperationToWorker ( @@ -1248,8 +1246,7 @@ export abstract class AbstractPool< }) const workerInfo = this.getWorkerInfo(workerNodeKey) this.sendToWorker(workerNodeKey, { - checkActive: true, - workerId: workerInfo.id as number + checkActive: true }) if (this.taskFunctions.size > 0) { for (const [taskFunctionName, taskFunction] of this.taskFunctions) {