Repository navigation
refactor: centralize sync polling in cron - #53
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.
Why
#49 introduced one shared cron, but syncs still carried individual polling intervals and due times. The cron should determine when every enabled sync polls and retries.
How
Remove per-sync intervals, polling deadlines, source retry backoff and its failure counter, and obsolete schedule displays. Each cron round polls enabled syncs and drains their pages; successful and failed syncs wait for the next tick. Overlapping triggers share the round. Manual execution, pauses, checkpoints, lease fencing, capacity recovery, and queued delivery retry policies remain intact.
Preserve the released schema as the initial migration and remove obsolete columns through a numbered forward SQL migration. SQLite parses and executes the plain SQL migration statements on the application's existing connection; the runner records migration history and rolls back failed upgrades.
createOpenSyncautomatically migrates an existing data directory. Upgrade coverage creates that directory using published0.3.1, then verifies preserved checkpoints, poll history, queued deliveries and asset bytes, provider configuration, owner isolation, and the embedding host's database.Host callers must remove
intervalMsand references tonextDueAt; there is no replacement per-sync deadline. Stop the host and back up its data directory before upgrading. Reverting to the previous binary requires restoring that backup.