Documentation
¶
Index ¶
- func IsQueueCleanupEnabled(cfg *config.Config) bool
- type Worker
- func (w *Worker) CleanupStuckQueue(ctx context.Context) error
- func (w *Worker) HandleImportFailure(ctx context.Context, downloadID, category string)
- func (w *Worker) Start(ctx context.Context) error
- func (w *Worker) Stop(ctx context.Context)
- func (w *Worker) SyncUnknownIndexerStats(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsQueueCleanupEnabled ¶ added in v0.3.0
IsQueueCleanupEnabled reports whether the queue cleanup feature should be active based on the global arrs.enabled and arrs.queue_cleanup_enabled flags.
Types ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) CleanupStuckQueue ¶ added in v0.3.0
CleanupStuckQueue scans every enabled *arr instance for items AltMount sent that are stuck importing for a known reason, then removes and blocklists them so the release is not grabbed again and the *arr searches for a replacement.
An item is only acted on after it has been continuously observed stuck for the configured grace period (transient errors that the *arr resolves on its own are left alone); ghost/empty-folder items are removed grace-free. The periodic run is gated by IsQueueCleanupEnabled at the caller (the worker tick); this method itself only requires arrs to be enabled.
func (*Worker) HandleImportFailure ¶ added in v0.3.0
HandleImportFailure runs the importer-side failure breaker for one permanently failed *arr-originated download. It closes the re-grab loop the queue-cleanup breaker can never see: AltMount fast-fails an import (e.g. dead articles), reports Failed via the SABnzbd API, and the *arr's failed-download handling blocklists only that one release and instantly re-searches — finding the same dead release on the next indexer, forever.
While the failed download is still in the *arr's queue (it stays there until the *arr's next completed-download poll), the owning instance is found by downloadID, every stable target in the download (episode/movie/album/book) is counted against the shared failure tracker, and targets at the queue_cleanup_max_failures threshold are given up on: unmonitored first, then the queue record is removed with blocklist-without-re-search — so the *arr neither auto-re-searches nor re-grabs the target.
Races: if the *arr's poll wins and the queue record is already gone, the count was still recorded and the next failure trips the give-up. Below the threshold nothing but counting happens — the *arr's normal blocklist-and-re-search failure handling is desirable for transient bad releases.