From: Jérôme Benoit Date: Tue, 22 Aug 2023 21:54:14 +0000 (+0200) Subject: refactor: silence rollup warning X-Git-Tag: v2.6.32~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f7426dd9c3d10e5b605b5f9d4417ccdabf1044d0;p=poolifier.git refactor: silence rollup warning Signed-off-by: Jérôme Benoit --- 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