Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
public setOptions (opts: InternalWorkerChoiceStrategyOptions): void {
this.opts = {
...getDefaultInternalWorkerChoiceStrategyOptions(
- this.pool.info.maxSize +
- Object.keys((opts?.weights as Record<number, number>) ?? {}).length
+ this.pool.info.maxSize + Object.keys(opts?.weights ?? {}).length
),
...opts
}
) {
this.opts = {
...getDefaultInternalWorkerChoiceStrategyOptions(
- pool.info.maxSize +
- Object.keys((this.opts?.weights as Record<number, number>) ?? {})
- .length
+ pool.info.maxSize + Object.keys(this.opts?.weights ?? {}).length
),
...this.opts
}
): void {
this.opts = {
...getDefaultInternalWorkerChoiceStrategyOptions(
- pool.info.maxSize +
- Object.keys((opts?.weights as Record<number, number>) ?? {}).length
+ pool.info.maxSize + Object.keys(opts?.weights ?? {}).length
),
...opts
}