From f7426dd9c3d10e5b605b5f9d4417ccdabf1044d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 22 Aug 2023 23:54:14 +0200 Subject: [PATCH] refactor: silence rollup warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/worker-node.ts | 4 ++-- src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 208acdab..d8044032 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -94,7 +94,7 @@ implements IWorkerNode { public enqueueTask (task: Task): number { const tasksQueueSize = this.tasksQueue.push(task) if (this.onBackPressure != null && this.hasBackPressure()) { - once(this.onBackPressure)(this.info.id as number) + once(this.onBackPressure, this)(this.info.id as number) } return tasksQueueSize } @@ -103,7 +103,7 @@ implements IWorkerNode { public unshiftTask (task: Task): number { const tasksQueueSize = this.tasksQueue.unshift(task) if (this.onBackPressure != null && this.hasBackPressure()) { - once(this.onBackPressure)(this.info.id as number) + once(this.onBackPressure, this)(this.info.id as number) } return tasksQueueSize } diff --git a/src/utils.ts b/src/utils.ts index 7927c973..6f9d1226 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -193,7 +193,7 @@ export const updateMeasurementStatistics = ( export const once = ( // eslint-disable-next-line @typescript-eslint/no-explicit-any fn: (...args: any[]) => void, - context = this + context: unknown // eslint-disable-next-line @typescript-eslint/no-explicit-any ): ((...args: any[]) => void) => { let called = false -- 2.34.1