(envVal: string | undefined, cpuCount: number)
| 110 | } |
| 111 | |
| 112 | export function resolveParsePoolSize(envVal: string | undefined, cpuCount: number): number { |
| 113 | if (envVal !== undefined && envVal !== '') { |
| 114 | const n = Number(envVal); |
| 115 | if (Number.isFinite(n) && n >= 0) { |
| 116 | return Math.max(1, Math.min(Math.floor(n), MAX_PARSE_POOL_SIZE)); |
| 117 | } |
| 118 | // non-numeric / negative → fall through to the default |
| 119 | } |
| 120 | return Math.max(1, Math.min(cpuCount - 1, DEFAULT_PARSE_POOL_CAP)); |
| 121 | } |
| 122 | |
| 123 | interface ParseJob { |
| 124 | id: number; |
no outgoing calls
no test coverage detected