diff --git a/app/src/lib/config/schema.ts b/app/src/lib/config/schema.ts index 4740508..ab4b7a2 100644 --- a/app/src/lib/config/schema.ts +++ b/app/src/lib/config/schema.ts @@ -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) => { diff --git a/app/src/lib/runner/engine.ts b/app/src/lib/runner/engine.ts index abf636b..bbbe869 100644 --- a/app/src/lib/runner/engine.ts +++ b/app/src/lib/runner/engine.ts @@ -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, diff --git a/docs/CONFIG_REFERENCE.md b/docs/CONFIG_REFERENCE.md index 89e1211..0b8118e 100644 --- a/docs/CONFIG_REFERENCE.md +++ b/docs/CONFIG_REFERENCE.md @@ -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[]`