From: Emanuele Stoppa Date: Fri, 8 Sep 2023 12:10:05 +0000 (+0100) Subject: chore: run lint fix X-Git-Tag: v2.6.43~7^2~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c3581f79ea34bd89cbdff40ac6c44eb7394f7919;p=poolifier.git chore: run lint fix --- diff --git a/benchmarks/versus-external-pools/dynamic-worker-nodes.js b/benchmarks/versus-external-pools/dynamic-worker-nodes.js index cdac7274..74b113c3 100644 --- a/benchmarks/versus-external-pools/dynamic-worker-nodes.js +++ b/benchmarks/versus-external-pools/dynamic-worker-nodes.js @@ -28,7 +28,7 @@ async function run () { // eslint-disable-next-line n/no-process-exit process.exit() } -;(async () => { +(async () => { try { await run() } catch (e) { diff --git a/benchmarks/versus-external-pools/fixed-worker-nodes.js b/benchmarks/versus-external-pools/fixed-worker-nodes.js index 94008400..e65e9888 100644 --- a/benchmarks/versus-external-pools/fixed-worker-nodes.js +++ b/benchmarks/versus-external-pools/fixed-worker-nodes.js @@ -28,7 +28,7 @@ async function run () { // eslint-disable-next-line n/no-process-exit process.exit() } -;(async () => { +(async () => { try { await run() } catch (e) { diff --git a/examples/typescript/pool.ts b/examples/typescript/pool.ts index 93774422..ab6d4f26 100644 --- a/examples/typescript/pool.ts +++ b/examples/typescript/pool.ts @@ -1,11 +1,11 @@ import { dirname, extname, join } from 'path' import { fileURLToPath } from 'url' -import type { MyData, MyResponse } from './worker' import { DynamicThreadPool, FixedThreadPool, availableParallelism } from 'poolifier' +import type { MyData, MyResponse } from './worker' const workerFile = join( dirname(fileURLToPath(import.meta.url)), diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index 9acfd640..d69055cf 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -82,7 +82,7 @@ export class FixedThreadPool< message: MessageValue, transferList?: TransferListItem[] ): void { - ;( + ( this.workerNodes[workerNodeKey].messageChannel as MessageChannel ).port1.postMessage(message, transferList) } @@ -108,7 +108,7 @@ export class FixedThreadPool< workerNodeKey: number, listener: (message: MessageValue) => void ): void { - ;( + ( this.workerNodes[workerNodeKey].messageChannel as MessageChannel ).port1.on('message', listener) } diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index dd116dfb..ca275ded 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -169,7 +169,7 @@ implements IWorkerNode { this.onEmptyQueueCount = 0 return } - ;(this.onEmptyQueue as WorkerNodeEventCallback)(this.info.id as number) + (this.onEmptyQueue as WorkerNodeEventCallback)(this.info.id as number) ++this.onEmptyQueueCount await sleep(exponentialDelay(this.onEmptyQueueCount)) await this.startOnEmptyQueue() diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index a0d78dbd..ca14133f 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -351,7 +351,7 @@ export abstract class AbstractWorker< protected handleKillMessage (message: MessageValue): void { this.stopCheckActive() if (isAsyncFunction(this.opts.killHandler)) { - ;(this.opts.killHandler?.() as Promise) + (this.opts.killHandler?.() as Promise) .then(() => { this.sendToMainWorker({ kill: 'success', workerId: this.id }) return null