From: Jérôme Benoit Date: Mon, 14 Oct 2024 12:24:39 +0000 (+0200) Subject: perf: pre-create worker if needed at the end of task execution X-Git-Tag: v4.3.0~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1d5588f7a7157f4214c0f326c294cd966525bee3;p=poolifier.git perf: pre-create worker if needed at the end of task execution Signed-off-by: Jérôme Benoit --- diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6b87c90d..27c9466c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,6 +19,9 @@ updates: update-types: - 'minor' - 'patch' + commitlint: + patterns: + - '@commitlint/*' labels: - 'dependencies' reviewers: diff --git a/biome.json b/biome.json index 0ac29993..0a62520f 100644 --- a/biome.json +++ b/biome.json @@ -17,10 +17,10 @@ }, "javascript": { "formatter": { + "arrowParentheses": "asNeeded", "quoteStyle": "single", - "trailingCommas": "es5", "semicolons": "asNeeded", - "arrowParentheses": "asNeeded" + "trailingCommas": "es5" } }, "json": { diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 7bbdb8ac..72507108 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -675,9 +675,7 @@ export abstract class AbstractPool< workerNode.info.dynamic = true if ( this.workerChoiceStrategiesContext?.getPolicy().dynamicWorkerReady === - true || - this.workerChoiceStrategiesContext?.getPolicy().dynamicWorkerUsage === - true + true ) { workerNode.info.ready = true } @@ -1221,6 +1219,9 @@ export abstract class AbstractPool< // FIXME: cannot be theoretically undefined. Schedule in the next tick to avoid race conditions? // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition workerNode?.emit('taskFinished', taskId) + if (this.shallCreateDynamicWorker()) { + this.createAndSetupDynamicWorkerNode() + } } }