From: Jérôme Benoit Date: Thu, 14 Sep 2023 12:58:22 +0000 (+0200) Subject: refactor: code cleanups X-Git-Tag: v2.7.0~1^2~34 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=419e812146b183bb91e1b0e01199fbe5aa11f7d2;p=poolifier.git refactor: code cleanups Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index eb517943a..e122e8818 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 (