From: Jérôme Benoit Date: Mon, 18 Apr 2022 08:03:50 +0000 (+0200) Subject: Silence a sonar code smell X-Git-Tag: v2.2.1~82 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=59a11fd24ca2ad0398859fe54fec74de63ea7053;p=poolifier.git Silence a sonar code smell Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 0883b03e..3a8414d8 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -21,6 +21,10 @@ export abstract class AbstractWorker< Data = unknown, Response = unknown > extends AsyncResource { + /** + * Options for the worker. + */ + public readonly opts: WorkerOptions /** * Timestamp of the last task processed by this worker. */ @@ -44,7 +48,7 @@ export abstract class AbstractWorker< isMain: boolean, fn: (data: Data) => Response, protected mainWorker: MainWorker | undefined | null, - public readonly opts: WorkerOptions = { + opts: WorkerOptions = { /** * The kill behavior option on this Worker or its default value. */ @@ -57,6 +61,7 @@ export abstract class AbstractWorker< } ) { super(type) + this.opts = opts this.checkFunctionInput(fn) this.checkWorkerOptions(this.opts) this.lastTaskTimestamp = Date.now()