feat(schedules): run jshvn/apartments every 4 hours, jittered - #12
Merged
Merged
Conversation
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.
What
every4hslot,2 */4 * * *UTC, replacinghourly.hourlyhad no targets; with every4h it would have been a sixth slot, and the tests hold SLOTS at five, the free plan's cron budget.JITTER: a slot can wait a random[0, n)minutes before dispatching.every4hwaits up to 30, so each run starts between :02 and :32, about 15 minutes either side of :17. The delay is drawn insidestep.do, so a restarted instance keeps its draw, and slept withstep.sleep, which costs no CPU. That adds two steps per firing.jshvn/apartmentswatch.ymlinevery4h. It pings no healthcheck by choice: failed runs comment on its report issue. The rule inschedules/index.tsand the README checklist now allow "or say what alerts instead".wrangler.jsoncregenerated bytask crons:17 5 * * *and2 */4 * * *, 2 of 5.Before merging
jshvnmust includejshvn/apartments(Settings -> Applications -> Installed GitHub Apps). Otherwise every4h fails its step withApp is not installed.Test plan
task check: types, biome, 46 vitest tests,wrangler deploy --dry-runpick a delay, thensleep jitter, then its dispatches, with the sleep under 30 minutes. It fails withJITTERemptied.eveningslot runs only dispatch steps.jshvn/apartmentswatch.ymlalready verified with a manualworkflow_dispatch(run 36074952086).task instancesshows an every4h instance sleeping, then dispatching.