Repository navigation
feat(scheduler): start timed workflows from a Cloudflare cron - #255
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 dispatchessweep.yml, pluslikes.ymlat :15,on-merge.ymlat :30,rot.ymlon Mondays at 06:45 andstars.ymldaily at 09:45. It has no URL, and the token it holds can only start Actions runs on this repo.likes.yml,on-merge.ymlandrot.ymllose 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.ymlandstars.ymlkeep 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.shnow lists thesitecheck 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, andwrangler deploy --dry-runis 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.