- Adding a job is one entry.
packages/api/src/platform/jobs/run.tsis now a table: each job states its name, whether it needs storage, its program, the idle summary an interrupted tick reports for it, and what it logs. The tick itself moved toplatform/jobs/tick.tsand applies the deadline, the isolation, the storage gate, the result fold and thejobs.tickline to every entry. Before, a new job editedrun.tsin seven or eight places. See Scheduled jobs. - The tick summary is keyed by job name.
pnpm jobs:runprints{ interrupted, audits, webhooks, push, ... }. Two shapes changed: the webhook counters moved from the top level towebhooks, andpushQueued/pushbecamepush.queued/push.sent. Thejobs.ticklog line keeps its keys and values (webhooks,pushQueued,push, counts only); only their order follows the table. - A job that throws while building its program fails as itself. The tick suspends each entry, so a synchronous throw is that job's failure instead of the tick's.
- Jobs live in
*.jobs.ts. The upload recovery job moved fromuploads.service.tstouploads.jobs.tsand the billing batch frombilling.reconcile.tstobilling.jobs.ts. A test now fails when the job table imports a feature by anything but its jobs, config, settings or outbox. See Backend conventions. - The tick is tested once. A generic suite runs a fake table through the tick (isolation, a
lastjob, the storage gate, the deadline on the test clock, the three log lines) without mocking a module; the production table's test only pins which jobs it lists and what they log.
A cron job is one entry in a table
The cron tick iterates one job table for isolation, the storage gate, the result, the interrupted summary and the log line, so adding a job no longer edits eight places.
Edit on GitHubDocumentation is in English.