Repository navigation
fix(backend-local): send a schedule pending across a restart - #842
Open
vercel[bot] wants to merge 1 commit into
Open
vercel[bot] wants to merge 1 commit into
vercel[bot] wants to merge 1 commit into
Conversation
Fixes #830 Co-authored-by: Julian Benegas <40034115+julianbenegas@users.noreply.github.com> Co-authored-by: garyhedgeme <178669136+garyhedgeme@users.noreply.github.com>
Contributor
Author
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch has not been deployed
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.
Fixes #830, picked up from an audit of open issues Julian Benegas asked for:
vb servesends a schedule that was pending when it stopped.vb servesends schedules across a restart: one that came due while it was down sends once, a repeating one goes on to its next slot.test/local.test.ts"sends a schedule after a restart…": a schedule on a file-backedlocal(), closed before its time, reopened twice; it sends once. Fails onmain(expected [] to deeply equal [ 'did it land?' ]).Users
The local scheduler's timers live in the process, and the arming consumer had already passed
schedule.created, so after a restart nothing armed them again (only a Vercel deployment's takeover re-arms). Now a board on an in-process scheduler re-arms every pending send on its first request, under a name of that start's own;duealready skips a timer for a send that isn't next, so nothing sends twice.On
main, scheduled--in 8s, server restarted before it, 40s later:With this, restarted, then restarted again: