Documentation
¶
Overview ¶
Package scheduler provides the periodic full-scan pipeline, DB maintenance, and auth cleanup scheduling for the subflux server.
Index ¶
Constants ¶
const AuthCleanupInterval = 15 * time.Minute
AuthCleanupInterval is how often expired sessions and stale auth state are purged from the database.
const OIDCStateTTL = 10 * time.Minute
OIDCStateTTL is how long an OIDC authorization flow can remain pending before garbage collection.
const StartupDelay = 30 * time.Second
StartupDelay is the delay before the first scan after startup.
Variables ¶
This section is empty.
Functions ¶
func GuardedScan ¶
GuardedScan acquires the scanning flag before running a full scan.
func RunDBMaintenance ¶
RunDBMaintenance prunes old state and stale search attempts.
func RunFullScan ¶
RunFullScan delegates to the scanning package's RunFullScan.
Types ¶
type Deps ¶
type Deps struct {
DB api.Store
Metrics scanning.ScanMetrics
ReconcileMetrics ReconcileMetrics // nil-safe; omit to skip reconcile metrics
Events *serveradapter.ScanEventAdapter
Activity *serveradapter.ActivityAdapter
Alerts *serveradapter.AlertAdapter
ShowSkipCache *showskip.Cache
StateFunc func() *LiveState
ScanningFlag *atomic.Bool
DeleteSubtitleFiles func(paths []string, source string)
}
Deps holds all dependencies for the scheduler.
type LiveState ¶
type LiveState struct {
Cfg api.ConfigProvider
Engine api.SearchEngine
Sonarr api.SonarrClient
Radarr api.RadarrClient
Providers []api.Provider
}
LiveState holds the live state needed by the scheduler.
type ReconcileMetrics ¶ added in v0.1.54
ReconcileMetrics is the narrow observability interface for reconcile passes. The concrete *metrics.Metrics satisfies this via structural typing.