From 1a28f967262fc8968d12fb0ef0be93f768607266 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 10 Sep 2023 13:06:01 +0200 Subject: [PATCH] docs: refine worker choice strategies ToC MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- docs/worker-choice-strategies.md | 2 +- src/pools/abstract-pool.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/worker-choice-strategies.md b/docs/worker-choice-strategies.md index d06ef8e0..bd5f9e2b 100644 --- a/docs/worker-choice-strategies.md +++ b/docs/worker-choice-strategies.md @@ -7,7 +7,7 @@ All duration or timestamp are expressed in milliseconds. - [Strategies](#strategies) - [Fair share](#fair-share) - [Weighted round robin](#weighted-round-robin) - - [Interleaved weighted round robin](#interleaved-weighted-round-robin-experimental) + - [Interleaved weighted round robin (experimental)](#interleaved-weighted-round-robin-experimental) - [Statistics](#statistics) - [Simple moving median](#simple-moving-median) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index fea2e3a1..3dcbceab 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -772,14 +772,13 @@ export abstract class AbstractPool< } const timestamp = performance.now() const workerNodeKey = this.chooseWorkerNode() - const workerInfo = this.getWorkerInfo(workerNodeKey) const task: Task = { name: name ?? DEFAULT_TASK_NAME, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions data: data ?? ({} as Data), transferList, timestamp, - workerId: workerInfo.id as number, + workerId: this.getWorkerInfo(workerNodeKey).id as number, taskId: randomUUID() } this.promiseResponseMap.set(task.taskId as string, { -- 2.34.1