Repository navigation
feat(scheduler): clean up torrents and data for cancelled requests - #506
Closed
ZillaGit104 wants to merge 1 commit into
Closed
ZillaGit104 wants to merge 1 commit into
ZillaGit104 wants to merge 1 commit into
Conversation
Owner
|
@ZillaGit104 this landed in #554 with you as co-author, and it's out now in v1.2.13. It keeps your cleanup of cancelled requests, with a few changes: only requests cancelled after the update are swept, a finished torrent seeds to its limits before it's removed, and API tokens cancel through |
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
No linked issue. This change introduces automated cleanup of torrents and partial files for cancelled requests.
What changed
cleanup_seeded_torrentsbackground processor with a dedicated pass that sweeps and removes torrents and files belonging to requests withstatus: 'cancelled'.addedByRmab) and ensures no other live (non-cancelled, non-failed) requests share the same torrent hash before triggering deletion.documentation/backend/services/scheduler.md.tests/processors/cleanup-seeded-torrents.cancelled.test.ts.Why
Previously, cancelling a request only changed its database status to
status: 'cancelled', leaving the associated torrent and its data active indefinitely in the download client. This caused orphaned downloads and wasted disk space that required manual intervention.How it was tested
tests/processors/cleanup-seeded-torrents.cancelled.test.ts) covering:npm testlocally to verify that all existing and new unit tests pass successfully.Checklist
Tests added or updated, and
npm testpassesDocs in
documentation/updated in the compact format (bullets, tables, short code blocks), plusdocumentation/TABLEOFCONTENTS.mdif a doc was addedNo secrets, API keys, passwords or personal data in the code, logs or screenshots