From 59a11fd24ca2ad0398859fe54fec74de63ea7053 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 18 Apr 2022 10:03:50 +0200 Subject: [PATCH] Silence a sonar code smell MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/abstract-worker.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() -- 2.34.1