(
rowCount: number,
opts: { baseMs: number; perRowMs: number }
)
| 42 | * runaway transaction cannot indefinitely pin a pool connection. |
| 43 | */ |
| 44 | export function scaledStatementTimeoutMs( |
| 45 | rowCount: number, |
| 46 | opts: { baseMs: number; perRowMs: number } |
| 47 | ): number { |
| 48 | const safeRowCount = Math.max(0, rowCount) |
| 49 | return Math.min(TIMEOUT_CAP_MS, Math.max(opts.baseMs, safeRowCount * opts.perRowMs)) |
| 50 | } |
no outgoing calls
no test coverage detected