* Parse the `--request-timeout ` flag value into milliseconds. * Returns `undefined` when the flag was not supplied (factory falls back to * the env var / default). Silently clamps out-of-range values.
(raw: string | undefined)
| 7691 | * the env var / default). Silently clamps out-of-range values. |
| 7692 | */ |
| 7693 | function parseRequestTimeoutFlag(raw: string | undefined): number | undefined { |
| 7694 | if (raw === undefined) return undefined; |
| 7695 | const n = Number(raw); |
| 7696 | if (!Number.isFinite(n) || n <= 0) return undefined; |
| 7697 | return Math.round(n * 1000); // seconds → milliseconds |
| 7698 | } |
| 7699 | |
| 7700 | /** D4: headroom added on top of `--timeout` when deriving the per-request window under `--wait`. */ |
| 7701 | const WAIT_REQUEST_TIMEOUT_CUSHION_MS = 5_000; |
no outgoing calls
no test coverage detected