From: Jérôme Benoit Date: Wed, 24 May 2023 17:28:00 +0000 (+0200) Subject: refactor: cleanup worker options X-Git-Tag: v2.5.0~26 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=353260e334c7f801b1236890f3a0cb8a98ed2b8e;p=poolifier.git refactor: cleanup worker options Signed-off-by: Jérôme Benoit --- diff --git a/README.md b/README.md index 6d4c35ef..18b0d78a 100644 --- a/README.md +++ b/README.md @@ -218,8 +218,6 @@ This method will call the terminate method on each worker. If `killBehavior` is set to `KillBehaviors.SOFT` your tasks have no timeout and your workers will not be terminated until your task is completed. Default: 60000 -- `async` (optional) - true/false. Set to true if your function contains async code pieces, else false. - Default: false - `killBehavior` (optional) - Dictates if your async unit (worker/process) will be deleted in case that a task is active on it. **KillBehaviors.SOFT**: If `currentTime - lastActiveTime` is greater than `maxInactiveTime` but a task is still running, then the worker **won't** be deleted. **KillBehaviors.HARD**: If `currentTime - lastActiveTime` is greater than `maxInactiveTime` but a task is still running, then the worker will be deleted. diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 16373669..a7060770 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -87,7 +87,6 @@ export abstract class AbstractWorker< this.opts.killBehavior = opts.killBehavior ?? DEFAULT_KILL_BEHAVIOR this.opts.maxInactiveTime = opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME - this.opts.async = opts.async ?? false } /**