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
- func Cleanup(c download.Cleaner) scheduler.JobFunc
- func DownloadMonitor(c download.Checker, a download.Adopter, imp importer.Enqueuer) scheduler.JobFunc
- func DriftCheck(s *hygiene.Service, interval time.Duration) scheduler.JobFunc
- func MetadataRefresh(r movie.MetadataRefresher) scheduler.JobFunc
- func MissingSearch(r rss.MissingSearchRunner) scheduler.JobFunc
- func OrphanScan(s *hygiene.Service) scheduler.JobFunc
- func PurgeSessions(p auth.SessionPurger) scheduler.JobFunc
- func RSSFeed(r rss.FeedRunner) scheduler.JobFunc
- func SeriesOrphanScan(s *hygiene.Service) scheduler.JobFunc
- func TVMetadataRefresh(r TVMetadataRefresher) scheduler.JobFunc
- type TVMetadataRefresher
Constants ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
TVMetadataRefresher re-pulls TVDB metadata for stale shows.