Documentation
¶
Overview ¶
Package health finds problems that stop Pilot from working: library folders that are missing or low on space, and download clients or indexers that are missing or unreachable. Like Sonarr's System > Status health list.
Library checks are local and cheap, so they run on every Report. Connectivity checks call each enabled client and indexer, so they run on a schedule (and on demand) and Report returns the last result.
Index ¶
Constants ¶
const ( SourceLibrary = "library" SourceDownloadClient = "download_client" SourceIndexer = "indexer" )
Source groups issues by what they are about.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Issue ¶
type Issue struct {
Source string `json:"source"`
Level Level `json:"level"`
Message string `json:"message"`
}
Issue is one problem.
type Lister ¶
type Lister[T any] interface { List(ctx context.Context) ([]T, error) Test(ctx context.Context, id string) error }
Lister is the part of the downloader and indexer services health uses.
type Report ¶
type Report struct {
Issues []Issue
// ConnectivityCheckedAt is when clients and indexers were last tested.
ConnectivityCheckedAt time.Time
}
Report is the current list of issues.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs health checks.
func NewService ¶
func NewService(q db.Querier, clients Lister[downloader.Config], indexers Lister[indexer.Config]) *Service
NewService creates a Service.
func (*Service) CheckConnectivity ¶
CheckConnectivity tests every enabled download client and indexer and stores the result. Concurrent calls share one run.