Commit Graph

4 Commits

Author SHA1 Message Date
Tes Sal
8d34bcf32e feat: use userTimezone as default for cron schedules
Fixes #3318

Previously, cron schedules without an explicit `tz` field would use
the system timezone, which could cause confusion if the server is in
a different timezone than the user.

Now, `agents.defaults.userTimezone` from the config is used as the
default timezone for cron schedule computations when the schedule
doesn't specify its own `tz`.

Changes:
- Added `defaultTimezone` option to `computeNextRunAtMs()`
- Added `defaultTimezone` to `CronServiceDeps`
- Gateway passes `userTimezone` from config to cron service
- All job computations now respect the default timezone
2026-01-28 13:03:17 +00:00
Peter Steinberger
c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
James Groat
7154bc6857 fix(cron): prevent every schedule from firing in infinite loop
When anchorMs is not provided (always in production), the schedule
computed nextRunAtMs as nowMs, causing jobs to fire immediately and
repeatedly instead of at the configured interval.

- Change nowMs <= anchor to nowMs < anchor to prevent early return
- Add Math.max(1, ...) to ensure steps is always at least 1
- Add test for anchorMs not provided case
2026-01-01 17:30:05 -07:00
Peter Steinberger
f9409cbe43 Cron: add scheduler, wakeups, and run history 2025-12-13 02:34:38 +00:00