scheduler

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Schedule defines when to run generation (cron format)
	// Default: "0 2 * * *" (daily at 2 AM)
	Schedule string
	// DryRun enables dry-run mode (no actual changes)
	DryRun bool
}

Config holds scheduler configuration

type Scheduler

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

Scheduler handles automated playlist generation on a cron schedule

func NewScheduler

func NewScheduler(
	cfg *Config,
	generator *playlist.Generator,
	themes []config.ThemeConfig,
	logger *slog.Logger,
) (*Scheduler, error)

NewScheduler creates a new scheduler instance

func (*Scheduler) GetNextRun

func (s *Scheduler) GetNextRun() time.Time

GetNextRun returns the next scheduled run time

func (*Scheduler) GetStatus

func (s *Scheduler) GetStatus() map[string]interface{}

GetStatus returns scheduler status information

func (*Scheduler) RunNow

func (s *Scheduler) RunNow(ctx context.Context, dryRun bool) error

RunNow triggers an immediate generation run

func (*Scheduler) Start

func (s *Scheduler) Start(ctx context.Context, schedule string, dryRun bool) error

Start starts the scheduler

func (*Scheduler) Stop

func (s *Scheduler) Stop() error

Stop stops the scheduler

Jump to

Keyboard shortcuts

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