Skip to content

feat(cron): support configurable run timeouts - #146

Merged
caiopizzol merged 2 commits into
mainfrom
feat/cron-timeouts
Jul 13, 2026
Merged

feat(cron): support configurable run timeouts#146
caiopizzol merged 2 commits into
mainfrom
feat/cron-timeouts

Conversation

@caiopizzol

@caiopizzol caiopizzol commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Cron jobs need an explicit runtime budget because long data refreshes can legitimately exceed Moor’s existing ten-minute exec limit. This keeps the current default while allowing operators to raise it per cron.

  • Preserves the ten-minute default for existing jobs
  • Validates and exposes the timeout consistently across API, UI, contract, and MCP
  • Adds migration coverage and end-to-end scheduler tests

Summary by cubic

Adds configurable per-cron run timeouts with a 10-minute default, so long-running jobs can exceed the previous limit. The timeout is validated, stored, and used during cron execution.

  • New Features

    • Database: added crons.timeout_ms (default 600,000 ms); migration v20.
    • API: create/update accept timeout_ms; strict validation (1 minute to 7 days); default applied if unset; scheduler passes timeout to container exec.
    • Web UI: cron editor adds a timeout (minutes) with inline validation; list shows a formatted timeout.
    • Contract (@moor-sh/contract): types include timeout_ms; exported CRON_TIMEOUT_* constants and validateCronTimeoutMs.
    • MCP tools: moor_cron_create/moor_cron_update accept and forward timeout_ms; tool descriptions and README document the default and 7-day max.
    • Tests: added migration, API route, validator, MCP tool, and execution coverage.
  • Migration

    • No action required; existing crons default to 10 minutes automatically.

Written for commit 7f61bfe. Summary will update on new commits.

Review in cubic

@caiopizzol
caiopizzol marked this pull request as ready for review July 13, 2026 13:45
@caiopizzol
caiopizzol merged commit fbccc03 into main Jul 13, 2026
3 checks passed
@caiopizzol
caiopizzol deleted the feat/cron-timeouts branch July 13, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant