From: Jérôme Benoit Date: Sat, 15 Oct 2022 22:05:40 +0000 (+0200) Subject: Cleanups X-Git-Tag: v2.3.4~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=fe2f6f840b801361c0f8a7ec090dc18b6b322cb0;p=poolifier.git Cleanups Signed-off-by: Jérôme Benoit --- diff --git a/.eslintrc.js b/.eslintrc.js index 11fb2803..f9453f90 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -35,6 +35,7 @@ module.exports = defineConfig({ 'warn', { skipWords: [ + 'browserslist', 'christopher', 'comparator', 'cpu', @@ -44,12 +45,14 @@ module.exports = defineConfig({ 'fibonacci', 'inheritDoc', 'jsdoc', + 'num', 'os', 'poolifier', 'readonly', 'serializable', 'sinon', 'tsconfig', + 'typedoc', 'unregister', 'workerpool' ], diff --git a/.vscode/settings.json b/.vscode/settings.json index 24c78410..6aff4400 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,18 +6,25 @@ "Alessandro", "Ardizio", "Benoit", + "caffeinate", "Dependabot", "Gitter", - "Shinigami", "inheritDoc", "lcov", "loglevel", "markdownlint", + "microjob", + "MYBENCH", "piment", "poolifier", + "poolify", "prettierx", "serializable", + "Shinigami", "standardx", + "suchmokuo", + "threadjs", + "threadwork", "workerpool" ], "sonarlint.connectedMode.project": { diff --git a/benchmarks/internal/benchmark-utils.js b/benchmarks/internal/benchmark-utils.js index 60cecbe5..8ea43599 100644 --- a/benchmarks/internal/benchmark-utils.js +++ b/benchmarks/internal/benchmark-utils.js @@ -10,7 +10,7 @@ async function runPoolifierTest (pool, { tasks, workerData }) { for (let i = 1; i <= tasks; i++) { pool .execute(workerData) - .then(res => { + .then(() => { executions++ if (executions === tasks) { return resolve('FINISH') @@ -73,7 +73,7 @@ function executeWorkerFunction (data) { case WorkerFunctions.jsonIntegerSerialization: return jsonIntegerSerialization(data.n || 1000) case WorkerFunctions.fibonacci: - return fibonacci(data.n || 50) + return fibonacci(data.n || 1000) case WorkerFunctions.factorial: return factorial(data.n || 1000) default: diff --git a/tests/worker-files/cluster/emptyWorker.js b/tests/worker-files/cluster/emptyWorker.js index 58c55af1..a0c94085 100644 --- a/tests/worker-files/cluster/emptyWorker.js +++ b/tests/worker-files/cluster/emptyWorker.js @@ -1,7 +1,7 @@ 'use strict' const { ClusterWorker, KillBehaviors } = require('../../../lib/index') -function test (data) {} +function test () {} module.exports = new ClusterWorker(test, { maxInactiveTime: 500, diff --git a/tests/worker-files/cluster/errorWorker.js b/tests/worker-files/cluster/errorWorker.js index d6d9297a..d23ba27b 100644 --- a/tests/worker-files/cluster/errorWorker.js +++ b/tests/worker-files/cluster/errorWorker.js @@ -1,7 +1,7 @@ 'use strict' const { ClusterWorker, KillBehaviors } = require('../../../lib/index') -function error (data) { +function error () { throw new Error('Error Message from ClusterWorker') } diff --git a/tests/worker-files/thread/emptyWorker.js b/tests/worker-files/thread/emptyWorker.js index 6a146c26..191c0331 100644 --- a/tests/worker-files/thread/emptyWorker.js +++ b/tests/worker-files/thread/emptyWorker.js @@ -1,7 +1,7 @@ 'use strict' const { ThreadWorker, KillBehaviors } = require('../../../lib/index') -function test (data) {} +function test () {} module.exports = new ThreadWorker(test, { maxInactiveTime: 500, diff --git a/tests/worker-files/thread/errorWorker.js b/tests/worker-files/thread/errorWorker.js index 841af907..c33dc1f0 100644 --- a/tests/worker-files/thread/errorWorker.js +++ b/tests/worker-files/thread/errorWorker.js @@ -1,7 +1,7 @@ 'use strict' const { ThreadWorker, KillBehaviors } = require('../../../lib/index') -function error (data) { +function error () { throw new Error('Error Message from ThreadWorker') }