repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: use pool side task functions list for hasTaskFunction()
[poolifier.git]
/
src
/
pools
/
abstract-pool.ts
diff --git
a/src/pools/abstract-pool.ts
b/src/pools/abstract-pool.ts
index 90cede3a8227f7e21cd7a0f32ec84e4f8e6bdbf6..1b53065c54e18318f1295bd68e6340dc5cbc76c1 100644
(file)
--- 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 {
/** @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 */
}
/** @inheritDoc */