Skip to content

feat(scheduler): start timed workflows from a Cloudflare cron - #255

Merged
jamesconwaydev merged 1 commit into
mainfrom
scheduler-worker
Nov 6, 2026
Merged

jamesconwaydev merged 1 commit into
mainfrom
scheduler-worker

Conversation

@jamesconwaydev

Copy link
Copy Markdown
Collaborator

GitHub's scheduler skipped most of our scheduled runs today. Likes went seven hours without a sync, on-merge fired about every six hours instead of every hour, and the 15-minute sweep fired a handful of times. #253 made any sweep that does run restart a stalled job. This replaces the timer itself.

scheduler/ is a Cloudflare Worker with one cron trigger every 15 minutes. Each tick dispatches sweep.yml, plus likes.yml at :15, on-merge.yml at :30, rot.yml on Mondays at 06:45 and stars.yml daily at 09:45. It has no URL, and the token it holds can only start Actions runs on this repo.

  • likes.yml, on-merge.yml and rot.yml lose their GitHub schedules. A second run of on-merge or rot would take the single list-writes queue slot and could push out a pending submission.
  • sweep.yml and stars.yml keep theirs as a fallback. If the Worker stops, the sweep watchdog still restarts likes and on-merge and runs an overdue health check.
  • setup_repo.sh now lists the site check that ci: run the site tests and build on every PR, not only after merge #254 made required.

The deploy steps and the token's exact scope are in scheduler/README.md. Tests: site/tests/scheduler.test.mjs (8 cases) plus the updated on-merge workflow test. 608 Python and 50 site tests pass, and wrangler deploy --dry-run is clean.

Until the Worker is deployed, likes, on-merge and rot only run when the sweep watchdog restarts them, so I'll deploy it right after merge.

…keeps skipping

GitHub's scheduler skipped most runs today: Likes went seven hours
without a sync. A Worker with one 15-minute cron now dispatches sweep,
likes, on-merge, the weekly health check and stars. likes, on-merge and
rot lose their GitHub schedules so nothing runs twice; sweep and stars
keep theirs as a fallback, and the sweep watchdog still restarts stalled
jobs if the Worker stops. setup_repo.sh also lists the new site check.
@jamesconwaydev
jamesconwaydev merged commit 35b5cd0 into main Nov 6, 2026
10 checks passed
@jamesconwaydev
jamesconwaydev deleted the scheduler-worker branch November 6, 2026 20:20
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