Repository navigation
chore(registry): prune finished durable jobs and embedding attempts - #691
Merged
Merged
Conversation
nuxt-cf-jobs soft-completes a job, so every hourly sync left up to 250 rows in `jobs` forever, with payloads and retry reasons. D1 is a 10 GB store and reached its limit on 2026-11-04. On 2026-11-12 `jobs` held 146,816 rows, `failed_jobs` 2,672, `job_batches` 3,332, and `embedding_attempts` 25,578, none of them pruned. A new hourly task deletes completed jobs after 7 days, failed jobs and embedding attempts after 30 days, and finished batches once no job names them, in bounded index-seeking batches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🤖 MERGED
GitHub merged this pull request.
f0f65b60-5cfe-43e5-a63a-53aa0ef1dbd7 Selected findings run after merge and open separate pull requests. |
1 of 6 tasks
Contributor
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: READY.
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.
🔗 Linked issue
Related to #126 (daily check-in: database capacity incident). Follows #688.
❓ Type of change
📚 Description
nuxt-cf-jobs soft-completes a job, so every hourly sync left up to 250
jobsrows behind, with payloads and retry reasons, forever. Nothing in this site called the package's prune methods.Measured on 2026-11-12 in production:
jobs146,816 rows,failed_jobs2,672,job_batches3,332,embedding_attempts25,578. A sampledjobsrow carries about 230 bytes of payload and retry text.This adds one hourly scheduled task,
prune-finished-jobs(40 * * * *), that deletes:jobsafter 7 days;failed_jobsafter 30 days;job_batchesonce no job names them;embedding_attemptsafter 30 days.Each DELETE seeks an existing index and removes at most 500 rows. A run issues at most 40 batches per table, so a backlog drains over a few runs and a run stays inside its 4-minute policy. The predicates match the package's own prune methods: a member of an unfinished batch stays, and batches go after their members, so the
jobs.batch_idforeign key holds.docs/arch/cron.mdis regenerated andpnpm cron:paritypasses.🤖 Generated with Claude Code