Help us shape the future of Go! Take the 2026 Go Developer Survey

scheduler

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: BSD-3-Clause Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const ActivitySweepJobName = "activity-sweep"
View Source
const (
	AnalyticsJobName = "analytics-heartbeat"
)
View Source
const ApnsOutboxJobName = "apns-outbox"
View Source
const (
	AutoHealJobName = "auto-heal"
)
View Source
const (
	AutoPatchJobName = "auto-patch"
)
View Source
const BackupRepositoryPruneJobName = "backup-repository-prune"

BackupRepositoryPruneJobName identifies the periodic prune of the local backup repositories.

View Source
const (
	DockerClientRefreshJobName = "docker-client-refresh"
)
View Source
const EventCleanupJobName = "event-cleanup"
View Source
const ExpiredSessionsCleanupJobName = "expired-sessions-cleanup"
View Source
const (
	// GitCloneCleanupJobName identifies the hourly purge of leaked git clone
	// scratch directories.
	GitCloneCleanupJobName = "git-clone-scratch-cleanup"
)
View Source
const (
	PruningVolumeHelperJobName = "pruning-volume-helper"
)
View Source
const ScheduledPruneJobName = "scheduled-prune"
View Source
const UpgradeLogCleanupJobName = "upgrade-log-cleanup"
View Source
const (
	// UploadSessionsCleanupJobName identifies the hourly purge of idle chunked
	// upload sessions.
	UploadSessionsCleanupJobName = "upload-sessions-cleanup"
)
View Source
const VulnerabilityRiskJobName = "vulnerability-risk"
View Source
const (
	VulnerabilityScanJobName = "vulnerability-scan"
)

Variables

This section is empty.

Functions

func NewAutoPatchJob added in v2.10.0

func NewAutoPatchJob(engine *flow.Engine, imageService *image.ImageService, settingsService *settings.SettingsService) *flow.Job

NewAutoPatchJob runs the durable auto-patch workflow. It is opt-in via the "imageAutoPatchEnabled" setting and defaults to daily at 03:00.

func NewAutoUpdateJob

func NewAutoUpdateJob(engine *flow.Engine, updaterService *updater.UpdaterService, settingsService *settings.SettingsService) *flow.Job

NewAutoUpdateJob runs the durable auto-update workflow on the configured schedule. Interrupted runs that cannot resume fall back to frozen-plan recovery.

func NewJobScheduler

func NewJobScheduler(ctx context.Context, coordinator *runs.Coordinator, location *time.Location) (st.JobScheduler, error)

func NewUpgradeLogCleanupJob added in v2.15.0

func NewUpgradeLogCleanupJob(service *system.SystemService) schedulertypes.Job

NewUpgradeLogCleanupJob creates the hourly local upgrade log cleanup job.

func NewVulnerabilityScanJob

func NewVulnerabilityScanJob(engine *flow.Engine, vulnerabilityService *vulnerability.VulnerabilityService, settingsService *settings.SettingsService) *flow.Job

NewVulnerabilityScanJob runs the durable vulnerability scan workflow. It is opt-in via the "vulnerabilityScanEnabled" setting and defaults to daily at midnight.

Types

type ActivitySweepJob added in v2.6.0

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

ActivitySweepJob periodically fails queued/running activities whose worker is no longer alive in this process, so a lost terminal write (crash, panic, dropped DB write) cannot leave an activity stuck in running forever. It is an internal job: it has no job_metadata entry and is invisible in the Jobs UI.

func NewActivitySweepJob added in v2.6.0

func NewActivitySweepJob(activityService *activity.ActivityService) *ActivitySweepJob

func (*ActivitySweepJob) Name added in v2.6.0

func (j *ActivitySweepJob) Name() string

func (*ActivitySweepJob) Run added in v2.6.0

func (*ActivitySweepJob) Schedule added in v2.6.0

func (j *ActivitySweepJob) Schedule(_ context.Context) string

type AnalyticsJob

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

func NewAnalyticsJob

func NewAnalyticsJob(
	settingsService *settings.SettingsService,
	kvService *kv.KVService,
	httpClient *http.Client,
	cfg *config.Config,
) *AnalyticsJob

func (*AnalyticsJob) Name

func (j *AnalyticsJob) Name() string

func (*AnalyticsJob) Reschedule

func (j *AnalyticsJob) Reschedule(ctx context.Context) error

func (*AnalyticsJob) Run

func (*AnalyticsJob) Schedule

func (j *AnalyticsJob) Schedule(_ context.Context) string

type ApnsOutboxJob added in v2.10.0

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

func NewApnsOutboxJob added in v2.10.0

func NewApnsOutboxJob(service *apns.ApnsService, cfg *config.Config) *ApnsOutboxJob

func (*ApnsOutboxJob) Name added in v2.10.0

func (j *ApnsOutboxJob) Name() string

func (*ApnsOutboxJob) Run added in v2.10.0

func (*ApnsOutboxJob) Schedule added in v2.10.0

func (j *ApnsOutboxJob) Schedule(_ context.Context) string

func (*ApnsOutboxJob) ShouldSchedule added in v2.10.0

func (j *ApnsOutboxJob) ShouldSchedule(ctx context.Context) bool

type AutoHealJob

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

func NewAutoHealJob

func NewAutoHealJob(
	dockerClientService *dockerInternal.DockerClientService,
	settingsService *settings.SettingsService,
	eventService *event.EventService,
	notificationService *notification.NotificationService,
	admissionGate *runs.Admission,
) (*AutoHealJob, error)

func (*AutoHealJob) CanRestartExported

func (j *AutoHealJob) CanRestartExported(containerID string, maxRestarts int, window time.Duration) bool

CanRestartExported exposes canRestart for testing.

func (*AutoHealJob) ListContainers added in v2.8.0

func (j *AutoHealJob) ListContainers(ctx context.Context, dockerClient *client.Client) ([]container.Summary, error)

func (*AutoHealJob) Name

func (j *AutoHealJob) Name() string

func (*AutoHealJob) Reconcile added in v2.11.0

func (j *AutoHealJob) Reconcile(ctx context.Context, previous schedulertypes.Run) (schedulertypes.Outcome, error)

func (*AutoHealJob) RecordRestartAtExported

func (j *AutoHealJob) RecordRestartAtExported(containerID string, t time.Time)

RecordRestartAtExported records a restart at a specific time for testing.

func (*AutoHealJob) RecordRestartExported

func (j *AutoHealJob) RecordRestartExported(containerID string)

RecordRestartExported exposes recordRestart for testing.

func (*AutoHealJob) Reschedule

func (j *AutoHealJob) Reschedule(ctx context.Context) error

func (*AutoHealJob) ResetRestartTracking

func (j *AutoHealJob) ResetRestartTracking()

ResetRestartTracking clears all restart records (exported for testing).

func (*AutoHealJob) Run

func (*AutoHealJob) Schedule

func (j *AutoHealJob) Schedule(ctx context.Context) string

func (*AutoHealJob) ShouldSchedule

func (j *AutoHealJob) ShouldSchedule(ctx context.Context) bool

type BackupRepositoryPruneJob added in v2.16.0

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

BackupRepositoryPruneJob removes packs that deleted backups left marked for deletion. Internal job: no job_metadata entry, invisible in the Jobs UI.

func NewBackupRepositoryPruneJob added in v2.16.0

func NewBackupRepositoryPruneJob(systemService *system.SystemService, volumeService *volume.VolumeService) *BackupRepositoryPruneJob

NewBackupRepositoryPruneJob builds the prune job for the scheduler.

func (*BackupRepositoryPruneJob) Name added in v2.16.0

func (j *BackupRepositoryPruneJob) Name() string

Name returns the job name.

func (*BackupRepositoryPruneJob) Reschedule added in v2.16.0

func (j *BackupRepositoryPruneJob) Reschedule(_ context.Context) error

Reschedule is a no-op: the schedule is fixed.

func (*BackupRepositoryPruneJob) Run added in v2.16.0

Run prunes the local system and volume backup repositories.

func (*BackupRepositoryPruneJob) Schedule added in v2.16.0

Schedule runs the prune twice a day, staggered after the default 03:00 system backup schedule. Rustic keeps marked packs for 23 hours, so a daily run could leave deleted data on disk for almost two days.

type DockerClientRefreshJob

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

DockerClientRefreshJob keeps the cached Docker client aligned with the daemon API version after daemon restarts or upgrades.

func NewDockerClientRefreshJob

func NewDockerClientRefreshJob(dockerClientService *docker.DockerClientService, settingsService *settings.SettingsService) *DockerClientRefreshJob

NewDockerClientRefreshJob creates the scheduled Docker client refresh job.

func (*DockerClientRefreshJob) Name

func (j *DockerClientRefreshJob) Name() string

func (*DockerClientRefreshJob) Run

func (*DockerClientRefreshJob) Schedule

func (j *DockerClientRefreshJob) Schedule(ctx context.Context) string

type EventCleanupJob

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

func NewEventCleanupJob

func NewEventCleanupJob(eventService *event.EventService, activityService *activity.ActivityService, settingsService *settings.SettingsService) *EventCleanupJob

func (*EventCleanupJob) Name

func (j *EventCleanupJob) Name() string

func (*EventCleanupJob) Reschedule

func (j *EventCleanupJob) Reschedule(ctx context.Context) error

func (*EventCleanupJob) Run

func (*EventCleanupJob) Schedule

func (j *EventCleanupJob) Schedule(ctx context.Context) string

type ExpiredSessionsCleanupJob

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

func NewExpiredSessionsCleanupJob

func NewExpiredSessionsCleanupJob(sessionService *session.SessionService, settingsService *settings.SettingsService) *ExpiredSessionsCleanupJob

func (*ExpiredSessionsCleanupJob) Name

func (*ExpiredSessionsCleanupJob) Reschedule

func (j *ExpiredSessionsCleanupJob) Reschedule(ctx context.Context) error

func (*ExpiredSessionsCleanupJob) Run

func (*ExpiredSessionsCleanupJob) Schedule

type FilesystemWatcherJob

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

func NewFilesystemWatcherJob

func NewFilesystemWatcherJob(
	ctx context.Context,
	projectService *project.ProjectService,
	templateService *template.TemplateService,
	settingsService *settings.SettingsService,
	projectScanDepth int,
) (*FilesystemWatcherJob, error)

func (*FilesystemWatcherJob) RestartProjectsWatcher

func (j *FilesystemWatcherJob) RestartProjectsWatcher(ctx context.Context) error

func (*FilesystemWatcherJob) RestartTemplatesWatcher

func (j *FilesystemWatcherJob) RestartTemplatesWatcher(ctx context.Context) error

func (*FilesystemWatcherJob) Start

func (j *FilesystemWatcherJob) Start(ctx context.Context) error

func (*FilesystemWatcherJob) Stop

type GitCloneCleanupJob added in v2.10.0

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

GitCloneCleanupJob purges orphaned "gitops-*" clone dirs under the git work dir. Internal job: no job_metadata entry, invisible in the Jobs UI.

func NewGitCloneCleanupJob added in v2.10.0

func NewGitCloneCleanupJob(repoService *gitrepo.GitRepositoryService, settingsService *settings.SettingsService) *GitCloneCleanupJob

NewGitCloneCleanupJob builds the cleanup job for the scheduler.

func (*GitCloneCleanupJob) Name added in v2.10.0

func (j *GitCloneCleanupJob) Name() string

func (*GitCloneCleanupJob) Reschedule added in v2.10.0

func (j *GitCloneCleanupJob) Reschedule(_ context.Context) error

func (*GitCloneCleanupJob) Run added in v2.10.0

func (*GitCloneCleanupJob) Schedule added in v2.10.0

func (j *GitCloneCleanupJob) Schedule(_ context.Context) string

type ImageUpdateWatcher added in v2.5.0

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

ImageUpdateWatcher debounces Docker events and admits durable image scans.

func NewImageUpdateWatcher added in v2.5.0

func NewImageUpdateWatcher(cfg *config.Config,
	imageUpdateService *imageupdate.ImageUpdateService,
	settingsService *settings.SettingsService,
	dockerService *docker.DockerClientService,
	projectService *project.ProjectService) (*ImageUpdateWatcher,
	error,
)

func (*ImageUpdateWatcher) Name added in v2.5.0

func (w *ImageUpdateWatcher) Name() string

func (*ImageUpdateWatcher) RefreshSchedule added in v2.5.0

func (w *ImageUpdateWatcher) RefreshSchedule()

func (*ImageUpdateWatcher) RunNow added in v2.5.0

func (w *ImageUpdateWatcher) RunNow(ctx context.Context) (err error)

func (*ImageUpdateWatcher) SetCoordinator added in v2.15.0

func (w *ImageUpdateWatcher) SetCoordinator(coordinator *runs.Coordinator)

func (*ImageUpdateWatcher) Start added in v2.5.0

func (w *ImageUpdateWatcher) Start(ctx context.Context) error

Start owns the debounce loop and joins its workers before returning.

func (*ImageUpdateWatcher) Stop added in v2.7.0

func (w *ImageUpdateWatcher) Stop(ctx context.Context) error

func (*ImageUpdateWatcher) Trigger added in v2.5.0

func (w *ImageUpdateWatcher) Trigger()

type PruningVolumeHelperJob

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

PruningVolumeHelperJob periodically removes idle volume workspace helper containers. The run frequency is fixed (every 5 minutes); how stale a helper must be pruned is driven by the volumeHelperIdleTimeout setting.

func NewPruningVolumeHelperJob

func NewPruningVolumeHelperJob(volumeService *volume.VolumeService, settingsService *settings.SettingsService) *PruningVolumeHelperJob

func (*PruningVolumeHelperJob) Name

func (j *PruningVolumeHelperJob) Name() string

func (*PruningVolumeHelperJob) Reschedule

func (j *PruningVolumeHelperJob) Reschedule(ctx context.Context) error

func (*PruningVolumeHelperJob) Run

func (*PruningVolumeHelperJob) Schedule

func (j *PruningVolumeHelperJob) Schedule(ctx context.Context) string

Schedule runs the pruning job every 5 minutes. This is intentionally not configurable; the idle timeout (read in Run) is the user-facing knob.

type ScheduledPruneJob

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

func NewScheduledPruneJob

func NewScheduledPruneJob(systemService *system.SystemService, settingsService *settings.SettingsService, notificationService *notification.NotificationService) *ScheduledPruneJob

func (*ScheduledPruneJob) Name

func (j *ScheduledPruneJob) Name() string

func (*ScheduledPruneJob) Reconcile added in v2.11.0

func (*ScheduledPruneJob) Reschedule

func (j *ScheduledPruneJob) Reschedule(ctx context.Context) error

func (*ScheduledPruneJob) Run

func (*ScheduledPruneJob) Schedule

func (j *ScheduledPruneJob) Schedule(ctx context.Context) string

func (*ScheduledPruneJob) ShouldSchedule

func (j *ScheduledPruneJob) ShouldSchedule(ctx context.Context) bool

type UploadSessionsCleanupJob added in v2.8.0

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

UploadSessionsCleanupJob purges upload sessions that have been idle for longer than uploadSessionMaxAge. It runs on managers and agents alike, since sessions live on whichever node serves the environment.

func NewUploadSessionsCleanupJob added in v2.8.0

func NewUploadSessionsCleanupJob(uploadService *upload.UploadService) *UploadSessionsCleanupJob

NewUploadSessionsCleanupJob builds the cleanup job for the scheduler.

func (*UploadSessionsCleanupJob) Name added in v2.8.0

func (j *UploadSessionsCleanupJob) Name() string

func (*UploadSessionsCleanupJob) Reschedule added in v2.8.0

func (j *UploadSessionsCleanupJob) Reschedule(ctx context.Context) error

func (*UploadSessionsCleanupJob) Run added in v2.8.0

func (*UploadSessionsCleanupJob) Schedule added in v2.8.0

type VulnerabilityRiskJob added in v2.14.0

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

VulnerabilityRiskJob refreshes KEV/EPSS threat intel and records the daily environment risk snapshot. It runs hourly; both steps are idempotent (intel is gated at 20h, the snapshot is a daily upsert).

func NewVulnerabilityRiskJob added in v2.14.0

func NewVulnerabilityRiskJob(vulnerabilityService *vulnerability.VulnerabilityService, settingsService *settings.SettingsService) *VulnerabilityRiskJob

NewVulnerabilityRiskJob creates a new VulnerabilityRiskJob.

func (*VulnerabilityRiskJob) Name added in v2.14.0

func (j *VulnerabilityRiskJob) Name() string

func (*VulnerabilityRiskJob) Run added in v2.14.0

func (*VulnerabilityRiskJob) Schedule added in v2.14.0

func (j *VulnerabilityRiskJob) Schedule(_ context.Context) string

func (*VulnerabilityRiskJob) ShouldSchedule added in v2.14.0

func (j *VulnerabilityRiskJob) ShouldSchedule(ctx context.Context) bool

Directories

Path Synopsis
Package entityjobs registers one dynamic scheduler job per database row, such as a GitOps sync or a backup policy.
Package entityjobs registers one dynamic scheduler job per database row, such as a GitOps sync or a backup policy.
Package flow runs durable multi-step jobs as Francis workflows inside coordinator runs.
Package flow runs durable multi-step jobs as Francis workflows inside coordinator runs.
flowtest
Package flowtest runs workflow engines on isolated Francis hosts for tests.
Package flowtest runs workflow engines on isolated Francis hosts for tests.
Package jobcontext carries durable execution progress through domain operations.
Package jobcontext carries durable execution progress through domain operations.
Package runs coordinates durable scheduler execution and recovery.
Package runs coordinates durable scheduler execution and recovery.
Package schedule provides reusable schedule validation.
Package schedule provides reusable schedule validation.

Jump to

Keyboard shortcuts

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