jobs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package jobs holds scheduler job constructors that bridge service packages to the scheduler without dragging infrastructure deps into the services themselves. Each file exports a constructor that returns a scheduler.JobFunc ready to register.

Index

Constants

View Source
const SessionPurgeGrace = 7 * 24 * time.Hour

SessionPurgeGrace is how long expired session rows are retained past expiry before deletion. Keeps a short audit window for post-incident forensics without letting the table grow unbounded.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(c download.Cleaner) scheduler.JobFunc

Cleanup returns a JobFunc that purges old download_records and movie events past their retention windows. The download purge runs first; an events-purge failure does not abort the tick — it logs and continues.

func DownloadMonitor

func DownloadMonitor(
	c download.Checker,
	a download.Adopter,
	imp importer.Enqueuer,
) scheduler.JobFunc

DownloadMonitor returns a scheduler.JobFunc that polls the download manager and forwards each completion to the importer, then runs the manual-torrent adoption pass and enqueues anything it auto-imported. Intended to run on a short interval (default 30s).

func DriftCheck

func DriftCheck(s *hygiene.Service, interval time.Duration) scheduler.JobFunc

DriftCheck returns a JobFunc that runs one drift_check pass against the tracked MediaFile rows. interval is forwarded into the service so the grace window scales with the schedule cadence.

func MetadataRefresh

func MetadataRefresh(r movie.MetadataRefresher) scheduler.JobFunc

MetadataRefresh returns a JobFunc that re-fetches TMDB data for movies whose update_time is older than the metadata-refresh interval.

func MissingSearch

func MissingSearch(r rss.MissingSearchRunner) scheduler.JobFunc

MissingSearch returns a JobFunc that runs one missing-search pass: per-title indexer queries against every wanted movie past cooldown.

func OrphanScan

func OrphanScan(s *hygiene.Service) scheduler.JobFunc

OrphanScan returns a JobFunc that runs one orphan_scan pass: walk library.movie_path, classify untracked media files, auto-import high-confidence matches, and queue the rest for human review.

func PurgeSessions

func PurgeSessions(p auth.SessionPurger) scheduler.JobFunc

PurgeSessions returns a scheduler JobFunc that deletes expired session rows older than SessionPurgeGrace. Intended to run hourly.

func RSSFeed

func RSSFeed(r rss.FeedRunner) scheduler.JobFunc

RSSFeed returns a JobFunc that runs one forward-feed scan over every enabled indexer.

func SeriesOrphanScan

func SeriesOrphanScan(s *hygiene.Service) scheduler.JobFunc

SeriesOrphanScan returns a JobFunc that runs one series_orphan_scan pass: walk library.series_path, classify untracked show folders against TVDB, and queue them into the Imports review surface for adoption.

func TVMetadataRefresh

func TVMetadataRefresh(r TVMetadataRefresher) scheduler.JobFunc

TVMetadataRefresh returns a JobFunc that re-fetches TVDB data for every tracked series.

Types

type TVMetadataRefresher

type TVMetadataRefresher interface {
	RefreshStale(ctx context.Context) error
}

TVMetadataRefresher re-pulls TVDB metadata for stale shows.

Directories

Path Synopsis
Package state persists scheduler run state to the scheduled_jobs table.
Package state persists scheduler run state to the scheduled_jobs table.

Jump to

Keyboard shortcuts

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