Skip to content

Fix cleanup pagination for seeded torrents - #288

Open
CrusaderPistol wants to merge 1 commit into
kikootwo:mainfrom
CrusaderPistol:fix/258-cleanup-pagination
Open

Fix cleanup pagination for seeded torrents#288
CrusaderPistol wants to merge 1 commit into
kikootwo:mainfrom
CrusaderPistol:fix/258-cleanup-pagination

Conversation

@CrusaderPistol

Copy link
Copy Markdown

Summary

Fixes #258.

The seeded torrent cleanup job previously limited its query to the first 100 eligible requests. Because each scheduled run could repeatedly query the same records, requests beyond that set could be starved indefinitely and never have their seeding requirements evaluated.

This change:

  • Processes eligible requests in deterministic batches of 100
  • Uses request ID progression instead of offset pagination
  • Avoids skipping records when requests are hard-deleted during processing
  • Tracks totalChecked across all processed batches
  • Preserves existing shared-torrent protection and seeding behavior
  • Adds a regression test covering more than 100 eligible requests
  • Verifies that the second batch continues after the last processed request ID

Testing

  • npx vitest run tests/processors/cleanup-seeded-torrents.processor.test.ts
    • 12 passed
  • npm test
    • 209 test files passed
    • 2623 tests passed
    • 4 skipped
  • npx tsc --noEmit
    • Passed
  • docker compose -f docker-compose.local.yml build readmeabook
    • Build successful
  • git diff --check
    • Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup Seeded Torrents job silently ignores requests past the first 100

1 participant