repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update dependencies
[poolifier.git]
/
src
/
worker
/
abstract-worker.ts
diff --git
a/src/worker/abstract-worker.ts
b/src/worker/abstract-worker.ts
index 0a6530e3889c61bb925ce4d787736ba72c104001..03d954fe62f1933594e4f556511e9762b7093fb5 100644
(file)
--- a/
src/worker/abstract-worker.ts
+++ b/
src/worker/abstract-worker.ts
@@
-41,11
+41,6
@@
export abstract class AbstractWorker<
*/
protected readonly interval?: NodeJS.Timeout
*/
protected readonly interval?: NodeJS.Timeout
- /**
- * This value is immediately set to true when the kill from the main worker is received.
- */
- private isKilled: boolean = false
-
/**
* Constructs a new poolifier worker.
*
/**
* Constructs a new poolifier worker.
*
@@
-95,7
+90,6
@@
export abstract class AbstractWorker<
this.mainWorker = value.parent
} else if (value.kill) {
// Here is time to kill this worker, just clearing the interval
this.mainWorker = value.parent
} else if (value.kill) {
// Here is time to kill this worker, just clearing the interval
- this.isKilled = true
if (this.interval) clearInterval(this.interval)
this.emitDestroy()
}
if (this.interval) clearInterval(this.interval)
this.emitDestroy()
}
@@
-134,7
+128,7
@@
export abstract class AbstractWorker<
* Check to see if the worker should be terminated, because its living too long.
*/
protected checkAlive (): void {
* Check to see if the worker should be terminated, because its living too long.
*/
protected checkAlive (): void {
- if (Date.now() - this.lastTask > this.maxInactiveTime
&& !this.isKilled
) {
+ if (Date.now() - this.lastTask > this.maxInactiveTime) {
this.sendToMainWorker({ kill: this.killBehavior })
}
}
this.sendToMainWorker({ kill: this.killBehavior })
}
}