feat(health): delete corrupted files instead of triggering repair#764
Merged
Conversation
Adds health.corruption_action ("repair" default, "delete") so users without
a reliable ARR-driven repair loop can have AltMount remove confirmed
(non-degraded) corrupted files instead of endlessly retriggering redownloads.
Wired into both the periodic health-check exhaustion path and the live
streaming-failure path; deletion cleans up metadata, the health record, the
physical library file, and any now-empty parent directories.
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
health.corruption_actionconfig option (repairdefault,delete) that changes what happens when the health checker or a live streaming read confirms real (non-degraded) corruption.delete, AltMount removes the file's metadata (and source NZB if configured), the physical library file, the health-DB record, and cleans up any now-empty parent directories — instead of triggering an Arr rescan/redownload.internal/health/worker.go) and the live streaming-failure path (internal/nzbfilesystem/metadata_remote_file.go), plus the repair-retry sweep for files already stuck inrepair_triggered.Test plan
go build ./.../go vet ./...go test -race ./internal/health/... ./internal/nzbfilesystem/... ./internal/config/... ./internal/metadata/...go test ./...(full repo)bun run check/bun run buildinfrontend//api/config