feat: add database-backed scheduler#2
Merged
Conversation
Expose standalone background job retry settings and validate database-backed background job payloads before persistence.
Continue scanning candidates after CAS misses and add retention cleanup for completed background jobs.
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.
Summary
JobRunContext.signalwhen lease renewal detects lost ownershipbackground_retention_ms(default 7 days)Test Plan
corepack pnpm --filter @tinyrack/tinyauth-server test -- --run src/entrypoints/scheduler/database.test.tscorepack pnpm testcorepack pnpm buildcorepack pnpm biome check .git diff --checkNotes
instanceIdremains internally generated by default (hostname:pid:uuid) to avoid lock-owner collisions across replicas; the programmatic override is kept for tests/debugging.AbortSignaland can stop side effects promptly when renewal returnsfalse; completion is still protected by the existing DB lease fencing.succeeded/failed) withcompletedAtolder than the configured retention window; pending/running jobs are never removed by cleanup.