failures

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package failures holds the in-memory per-target failure counts behind the arrs circuit breaker (arrs.queue_cleanup_max_failures). The tracker is shared by every producer of AltMount→arr re-acquire requests — the queue-cleanup worker, the health-repair re-trigger and the partial-pack reconcile sweep — so a target (a Radarr movie, a Sonarr/Whisparr episode, ...) that keeps failing accumulates one combined count no matter which path acted on it. Counts are in-memory only: they reset on restart and when a target imports healthy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlbumKey

func AlbumKey(instanceName string, albumID int64) string

AlbumKey keys a Lidarr album.

func BookKey

func BookKey(instanceName string, bookID int64) string

BookKey keys a Readarr book.

func EpisodeKey

func EpisodeKey(instanceName string, episodeID int64) string

EpisodeKey keys a Sonarr/Whisparr episode.

func MovieKey

func MovieKey(instanceName string, movieID int64) string

MovieKey keys a Radarr movie.

Types

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Tracker counts failures per stable target key.

func NewTracker

func NewTracker() *Tracker

NewTracker creates an empty failure tracker.

func (*Tracker) Bump

func (t *Tracker) Bump(key string) int

Bump records one more failure-driven action against a target and returns the new running count. A nil tracker or empty key is a no-op returning 0.

func (*Tracker) Reset

func (t *Tracker) Reset(key string)

Reset clears a target's failure count (e.g. after it imports healthy).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL