From: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:09:14 +0000 (+0000) Subject: [autofix.ci] apply automated fixes X-Git-Tag: v4.4.0~16^2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e7730ecc57984719d149b4dd86b3bd164636f19e;p=poolifier.git [autofix.ci] apply automated fixes --- diff --git a/benchmarks/benchmarks-utils.cjs b/benchmarks/benchmarks-utils.cjs index 30eb1e2b..2f401e80 100644 --- a/benchmarks/benchmarks-utils.cjs +++ b/benchmarks/benchmarks-utils.cjs @@ -76,12 +76,12 @@ const readWriteFiles = ( const executeTaskFunction = data => { switch (data.function) { - case TaskFunctions.jsonIntegerSerialization: - return jsonIntegerSerialization(data.taskSize || 1000) - case TaskFunctions.fibonacci: - return fibonacci(data.taskSize || 1000) case TaskFunctions.factorial: return factorial(data.taskSize || 1000) + case TaskFunctions.fibonacci: + return fibonacci(data.taskSize || 1000) + case TaskFunctions.jsonIntegerSerialization: + return jsonIntegerSerialization(data.taskSize || 1000) case TaskFunctions.readWriteFiles: return readWriteFiles(data.taskSize || 1000) default: diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 1a1f207b..73160a25 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -298,16 +298,16 @@ export class WorkerNode this.closeMessageChannel() this.removeAllListeners() switch (this.info.type) { - case WorkerTypes.thread: - this.worker.unref?.() - await this.worker.terminate?.() - break case WorkerTypes.cluster: this.registerOnceWorkerEventHandler('disconnect', () => { this.worker.kill?.() }) this.worker.disconnect?.() break + case WorkerTypes.thread: + this.worker.unref?.() + await this.worker.terminate?.() + break } await waitWorkerExit }