Allow timeoutSeconds: 0 to mean no timeout
Previously every script was forced to have a positive timeout capped at 24h, with no way to run something genuinely unbounded. execa only enforces its timeout option when it's greater than 0, so this just relaxes the schema's lower bound from positive to >= 0 and lets that flow through unchanged - no engine logic needed beyond a clarifying comment. The 1800s default and 86400s cap for finite timeouts are unchanged; 0 is an explicit opt-in, not the default. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -174,7 +174,8 @@ const scriptSchema = z
|
||||
args: z.array(z.string()).default([]),
|
||||
cwd: z.string().default("./"),
|
||||
shell: z.boolean().default(false),
|
||||
timeoutSeconds: z.number().int().positive().max(86400).default(1800),
|
||||
// 0 means no timeout - execa only enforces the timeout when it's > 0.
|
||||
timeoutSeconds: z.number().int().min(0).max(86400).default(1800),
|
||||
variables: z.array(variableWithChecks).default([]),
|
||||
})
|
||||
.superRefine((script, ctx) => {
|
||||
|
||||
@@ -117,6 +117,7 @@ async function executeRun(
|
||||
...process.env,
|
||||
...invocation.env,
|
||||
},
|
||||
// `timeoutSeconds: 0` means no timeout - execa only enforces this when > 0.
|
||||
timeout: script.timeoutSeconds * 1000,
|
||||
cancelSignal: controller.signal,
|
||||
reject: false,
|
||||
|
||||
@@ -63,7 +63,7 @@ pass `--inline` to those commands to get the raw hash printed for pasting into t
|
||||
| `args` | string[] | `[]` | Fixed leading args, before variable-derived ones |
|
||||
| `cwd` | string | `./` | Resolved relative to the config file's directory |
|
||||
| `shell` | boolean | `false` | Opt-in shell interpretation — see the Security Notes in the README before using this |
|
||||
| `timeoutSeconds` | number | `1800` | 1–86400 |
|
||||
| `timeoutSeconds` | number | `1800` | 0–86400. `0` means no timeout - the run is never killed for taking too long |
|
||||
| `variables` | array | `[]` | See below |
|
||||
|
||||
## `scripts[].variables[]`
|
||||
|
||||
Reference in New Issue
Block a user