X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=1b53065c54e18318f1295bd68e6340dc5cbc76c1;hb=edbc15c62f491f28a09a03a4cc134a8a9522059e;hp=90cede3a8227f7e21cd7a0f32ec84e4f8e6bdbf6;hpb=71cad0b00456d2f7cf0987604062674ff19b44c4;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 90cede3a..1b53065c 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -737,11 +737,15 @@ export abstract class AbstractPool< /** @inheritDoc */ public hasTaskFunction (name: string): boolean { - this.sendToWorkers({ - taskFunctionOperation: 'has', - taskFunctionName: name - }) - return true + for (const workerNode of this.workerNodes) { + if ( + Array.isArray(workerNode.info.taskFunctionNames) && + workerNode.info.taskFunctionNames.includes(name) + ) { + return true + } + } + return false } /** @inheritDoc */