| 55 | } |
| 56 | |
| 57 | function parseArgs(argv: string[]): Options { |
| 58 | const maxBatchesArg = argv.find((a) => a.startsWith('--max-batches=')) |
| 59 | const maxBatches = maxBatchesArg |
| 60 | ? Number.parseInt(maxBatchesArg.slice('--max-batches='.length), 10) |
| 61 | : Number.POSITIVE_INFINITY |
| 62 | |
| 63 | if (Number.isNaN(maxBatches) || maxBatches <= 0) { |
| 64 | throw new Error('--max-batches must be a positive integer') |
| 65 | } |
| 66 | |
| 67 | return { maxBatches } |
| 68 | } |
| 69 | |
| 70 | /** Externalize inline heavy execution_data into the large-value store. */ |
| 71 | async function backfillTraceStorage( |