cronfrontend

package
v0.2.40 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cronfrontend schedules cron producers and their conversation Sync.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateRuntimeDefinitions

func ValidateRuntimeDefinitions(cfg *config.LockedConfig, runtimeDir string) error

ValidateRuntimeDefinitions loads cron definitions and routines from runtimeDir without mutating scheduler state.

Types

type Job

type Job struct {
	RelativePath, Agent, Body, Space string
	Schedules                        []string
	Upcoming                         []time.Time
}

Job is the read-only presentation of a loaded definition and its next triggers.

type Manager

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

Manager loads and runs workspace cron definitions.

func New

func New(cfg *config.LockedConfig, runtimeDir string, store cronScheduleStore, run Runner, logger *slog.Logger) *Manager

New constructs a cronjob manager using runtimeDir for effective runtime cron definitions and agents' routines.

func (*Manager) Jobs

func (m *Manager) Jobs() ([]Job, error)

Jobs returns loaded definitions and their next triggers in the next day. It neither refreshes scheduler state nor claims any work.

func (*Manager) LoadOneOffCronjob

func (m *Manager) LoadOneOffCronjob(target string) (protocol.OneOffCronjob, error)

LoadOneOffCronjob resolves and loads one live cronjob, a cron file or a routine, for a run from Web.

func (*Manager) Refresh added in v0.2.21

func (m *Manager) Refresh() error

Refresh loads the cron definitions anew; a reload calls it once it has validated and installed them. It syncs the schedules table before the scheduler uses them, and a load or sync error leaves both unchanged.

func (*Manager) RunOneOffCronjob

func (m *Manager) RunOneOffCronjob(ctx context.Context, job *protocol.OneOffCronjob) (protocol.CronRunResult, error)

RunOneOffCronjob waits for a loaded producer and its required Sync.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start loads cron definitions and starts scheduling them.

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop shuts the cron manager down.

type Runner

Runner executes a producer through terminal delivery.

Jump to

Keyboard shortcuts

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