repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: fix pool starting detection
[poolifier.git]
/
src
/
pools
/
abstract-pool.ts
diff --git
a/src/pools/abstract-pool.ts
b/src/pools/abstract-pool.ts
index b43d44a59eea1cb1c7990e660b96cb4cd5483a03..50ce2026d4f2e17f182f773227c2bc51f22de26f 100644
(file)
--- a/
src/pools/abstract-pool.ts
+++ b/
src/pools/abstract-pool.ts
@@
-84,6
+84,10
@@
export abstract class AbstractPool<
Response
>
Response
>
+ /**
+ * Whether the pool is starting.
+ */
+ private readonly starting: boolean
/**
* The start timestamp of the pool.
*/
/**
* The start timestamp of the pool.
*/
@@
-128,6
+132,7
@@
export abstract class AbstractPool<
this.setupHook()
this.setupHook()
+ this.starting = true
while (
this.workerNodes.reduce(
(accumulator, workerNode) =>
while (
this.workerNodes.reduce(
(accumulator, workerNode) =>
@@
-137,6
+142,7
@@
export abstract class AbstractPool<
) {
this.createAndSetupWorker()
}
) {
this.createAndSetupWorker()
}
+ this.starting = false
this.startTimestamp = performance.now()
}
this.startTimestamp = performance.now()
}
@@
-416,16
+422,6
@@
export abstract class AbstractPool<
}
}
}
}
- private get starting (): boolean {
- return (
- this.workerNodes.reduce(
- (accumulator, workerNode) =>
- !workerNode.info.dynamic ? accumulator + 1 : accumulator,
- 0
- ) < this.minSize
- )
- }
-
private get ready (): boolean {
return (
this.workerNodes.reduce(
private get ready (): boolean {
return (
this.workerNodes.reduce(