Skip to content

Keep cron fire history out of scheduler scans - #614

Merged
16francej merged 4 commits into
mainfrom
codex/cron-fire-history
Aug 21, 2026
Merged

Keep cron fire history out of scheduler scans#614
16francej merged 4 commits into
mainfrom
codex/cron-fire-history

Conversation

@16francej

@16francej 16francej commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • store cron fire history in a dedicated durable table instead of inline cron records
  • migrate existing inline history without dropping retention
  • page run-history reads while keeping scheduler list/get calls lightweight

Why

Scheduler scans read cron metadata frequently but never need fire history. Keeping an ever-growing history array inside each cron makes every scan clone unrelated historical payloads and can amplify memory use.

Verification

  • formatting, ESLint, oxlint, and TypeScript checks
  • focused cron/API tests
  • PostgreSQL migration, paging, and cross-process persistence tests
  • concurrent old-writer/new-migrator rollout test
  • two-instance queue test
  • live browser flow: create cron, scheduled fire, manual fire, and run-history UI
  • direct database check: cron rows contain no inline fireLog; both fire records remain in the history table

Rollout

Deploy new replicas with background work disabled, route traffic to them, then enable background work and demote old replicas. This keeps old API readers serving until the new readers own traffic; the first active scheduler then performs the atomic history cutover.

History retention remains indefinite and worker concurrency is unchanged.

@16francej
16francej marked this pull request as ready for review August 21, 2026 19:33
@16francej
16francej merged commit 72472a7 into main Aug 21, 2026
21 checks passed
@16francej
16francej deleted the codex/cron-fire-history branch August 21, 2026 19:47
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