mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 15:20:13 +00:00
fix(engine): honor explicit render worker counts (#2439)
This commit is contained in:
@@ -160,6 +160,10 @@ export function calculateOptimalWorkers(
|
||||
requested?: number,
|
||||
config?: WorkerSizingConfig,
|
||||
): number {
|
||||
if (requested !== undefined) {
|
||||
return Math.max(MIN_WORKERS, Math.min(ABSOLUTE_MAX_WORKERS, requested));
|
||||
}
|
||||
|
||||
// Resolve effective values: config overrides → DEFAULT_CONFIG fallback.
|
||||
const effectiveMaxWorkers = (() => {
|
||||
const concurrency = config?.concurrency ?? DEFAULT_CONFIG.concurrency;
|
||||
@@ -174,10 +178,6 @@ export function calculateOptimalWorkers(
|
||||
config?.largeRenderThreshold ?? DEFAULT_CONFIG.largeRenderThreshold;
|
||||
const captureCostMultiplier = Math.max(1, config?.captureCostMultiplier ?? 1);
|
||||
|
||||
if (requested !== undefined) {
|
||||
return Math.max(MIN_WORKERS, Math.min(effectiveMaxWorkers, requested));
|
||||
}
|
||||
|
||||
if (totalFrames < MIN_FRAMES_PER_WORKER * 2) return 1;
|
||||
|
||||
const cpuCount = cpus().length;
|
||||
|
||||
Reference in New Issue
Block a user