FactoryWager Wiki

Cron contract

Claim

OS-persistent is primary. In-process is the complement.

Corrected 2026-07-21 (was inverted).

Evidence

Primary — OS-persistent

Survives reboot. System local time. Fresh process each fire.

Complement — in-process

Dies with the process. UTC. Shared state. No overlap (next fire after handler Promise settles). Errors match setTimeout (uncaughtException / unhandledRejection). --hot safe. Disposable via using job = ….

Align both with TZ=UTC when you need them to agree.

Owner

lib/harness/cron.ts + spine/scheduler.ts + spine/tenants.ts

Ratchet

bun run test:cron      # complement + contract docs
bun run test:cron-os   # OS-persistent primary journey
bun run spine:schedule:once -- --tenant=install-verify   # multi-tenant smoke

Lookup: bun tools/bun-doc-refs.ts url Bun.cron