repositories
/
poolifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49beedc
)
refactor: cleanup default arguments handling
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Wed, 20 Dec 2023 23:04:01 +0000
(
00:04
+0100)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Wed, 20 Dec 2023 23:04:01 +0000
(
00:04
+0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/utils.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils.ts
b/src/utils.ts
index 8e84e9474c8a91d1adceb740e5c5ff21292faa02..3226e7eb3499af2fe2b1b6000962c83e14f10992 100644
(file)
--- a/
src/utils.ts
+++ b/
src/utils.ts
@@
-304,8
+304,9
@@
export const buildInternalWorkerChoiceStrategyOptions = (
const getDefaultWeights = (
poolMaxSize: number,
- defaultWorkerWeight
: number = getDefaultWorkerWeight()
+ defaultWorkerWeight
?: number
): Record<number, number> => {
+ defaultWorkerWeight = defaultWorkerWeight ?? getDefaultWorkerWeight()
const weights: Record<number, number> = {}
for (let workerNodeKey = 0; workerNodeKey < poolMaxSize; workerNodeKey++) {
weights[workerNodeKey] = defaultWorkerWeight