repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: allow to disable tasks timeout check in worker
[poolifier.git]
/
src
/
worker
/
abstract-worker.ts
diff --git
a/src/worker/abstract-worker.ts
b/src/worker/abstract-worker.ts
index 8a38b4e576464ecb88078540cc8604d7b3ad323f..2afd6f3486a1103347a258c575cece7773e3c4d3 100644
(file)
--- a/
src/worker/abstract-worker.ts
+++ b/
src/worker/abstract-worker.ts
@@
-71,7
+71,10
@@
export abstract class AbstractWorker<
super(type)
this.checkWorkerOptions(this.opts)
this.checkTaskFunctions(taskFunctions)
super(type)
this.checkWorkerOptions(this.opts)
this.checkTaskFunctions(taskFunctions)
- if (!this.isMain) {
+ if (
+ !this.isMain &&
+ (this.opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME) > 0
+ ) {
this.lastTaskTimestamp = performance.now()
this.aliveInterval = setInterval(
this.checkAlive.bind(this),
this.lastTaskTimestamp = performance.now()
this.aliveInterval = setInterval(
this.checkAlive.bind(this),