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

scheduler

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnalyticsJobName = "analytics-heartbeat"
)
View Source
const AutoHealJobName = "auto-heal"
View Source
const DockerClientRefreshJobName = "docker-client-refresh"
View Source
const EventCleanupJobName = "event-cleanup"
View Source
const ExpiredSessionsCleanupJobName = "expired-sessions-cleanup"
View Source
const (
	PruningVolumeHelperJobName = "pruning-volume-helper"
)
View Source
const ScheduledPruneJobName = "scheduled-prune"
View Source
const VulnerabilityScanJobName = "vulnerability-scan"

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsJob

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

func NewAnalyticsJob

func NewAnalyticsJob(
	settingsService *services.SettingsService,
	kvService *services.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 (j *AnalyticsJob) Run(ctx context.Context)

func (*AnalyticsJob) Schedule

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

type AutoHealJob added in v1.16.0

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

func NewAutoHealJob added in v1.16.0

func NewAutoHealJob(
	dockerClientService *services.DockerClientService,
	settingsService *services.SettingsService,
	eventService *services.EventService,
	notificationService *services.NotificationService,
) *AutoHealJob

func (*AutoHealJob) CanRestartExported added in v1.16.0

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

CanRestartExported exposes canRestart for testing.

func (*AutoHealJob) Name added in v1.16.0

func (j *AutoHealJob) Name() string

func (*AutoHealJob) RecordRestartAtExported added in v1.16.0

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

RecordRestartAtExported records a restart at a specific time for testing.

func (*AutoHealJob) RecordRestartExported added in v1.16.0

func (j *AutoHealJob) RecordRestartExported(containerID string)

RecordRestartExported exposes recordRestart for testing.

func (*AutoHealJob) Reschedule added in v1.16.0

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

func (*AutoHealJob) ResetRestartTracking added in v1.16.0

func (j *AutoHealJob) ResetRestartTracking()

ResetRestartTracking clears all restart records (exported for testing).

func (*AutoHealJob) Run added in v1.16.0

func (j *AutoHealJob) Run(ctx context.Context)

func (*AutoHealJob) Schedule added in v1.16.0

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

func (*AutoHealJob) ShouldSchedule added in v1.17.0

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

type AutoUpdateJob

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

func NewAutoUpdateJob

func NewAutoUpdateJob(updaterService *services.UpdaterService, settingsService *services.SettingsService) *AutoUpdateJob

func (*AutoUpdateJob) Name

func (j *AutoUpdateJob) Name() string

func (*AutoUpdateJob) Reschedule

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

func (*AutoUpdateJob) Run

func (j *AutoUpdateJob) Run(ctx context.Context)

func (*AutoUpdateJob) Schedule

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

func (*AutoUpdateJob) ShouldSchedule added in v1.17.0

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

type DockerClientRefreshJob added in v1.19.0

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 added in v1.19.0

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

NewDockerClientRefreshJob creates the scheduled Docker client refresh job.

func (*DockerClientRefreshJob) Name added in v1.19.0

func (j *DockerClientRefreshJob) Name() string

func (*DockerClientRefreshJob) Run added in v1.19.0

func (*DockerClientRefreshJob) Schedule added in v1.19.0

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

type EnvironmentHealthJob

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

func NewEnvironmentHealthJob

func NewEnvironmentHealthJob(environmentService *services.EnvironmentService, settingsService *services.SettingsService) *EnvironmentHealthJob

func (*EnvironmentHealthJob) Name

func (j *EnvironmentHealthJob) Name() string

func (*EnvironmentHealthJob) Reschedule

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

func (*EnvironmentHealthJob) Run

func (j *EnvironmentHealthJob) Run(ctx context.Context)

func (*EnvironmentHealthJob) Schedule

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

type EventCleanupJob

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

func NewEventCleanupJob

func NewEventCleanupJob(eventService *services.EventService, settingsService *services.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 (j *EventCleanupJob) Run(ctx context.Context)

func (*EventCleanupJob) Schedule

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

type ExpiredSessionsCleanupJob added in v1.19.1

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

func NewExpiredSessionsCleanupJob added in v1.19.1

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

func (*ExpiredSessionsCleanupJob) Name added in v1.19.1

func (*ExpiredSessionsCleanupJob) Reschedule added in v1.19.1

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

func (*ExpiredSessionsCleanupJob) Run added in v1.19.1

func (*ExpiredSessionsCleanupJob) Schedule added in v1.19.1

type FilesystemWatcherJob

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

func NewFilesystemWatcherJob

func NewFilesystemWatcherJob(
	projectService *services.ProjectService,
	templateService *services.TemplateService,
	settingsService *services.SettingsService,
	projectScanDepth int,
) *FilesystemWatcherJob

func RegisterFilesystemWatcherJob

func RegisterFilesystemWatcherJob(ctx context.Context, projectService *services.ProjectService, templateService *services.TemplateService, settingsService *services.SettingsService, projectScanDepth int) (*FilesystemWatcherJob, error)

func (*FilesystemWatcherJob) RestartProjectsWatcher

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

func (*FilesystemWatcherJob) RestartTemplatesWatcher added in v1.19.4

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

func (*FilesystemWatcherJob) Start

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

func (*FilesystemWatcherJob) Stop

func (j *FilesystemWatcherJob) Stop() error

type GitOpsSyncJob

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

func NewGitOpsSyncJob

func NewGitOpsSyncJob(syncService *services.GitOpsSyncService, settingsService *services.SettingsService) *GitOpsSyncJob

func (*GitOpsSyncJob) Name

func (j *GitOpsSyncJob) Name() string

func (*GitOpsSyncJob) Run

func (j *GitOpsSyncJob) Run(ctx context.Context)

func (*GitOpsSyncJob) Schedule

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

func (*GitOpsSyncJob) ShouldSchedule added in v1.17.0

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

type ImagePollingJob

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

func NewImagePollingJob

func NewImagePollingJob(imageUpdateService *services.ImageUpdateService, settingsService *services.SettingsService, environmentService *services.EnvironmentService) *ImagePollingJob

func (*ImagePollingJob) Name

func (j *ImagePollingJob) Name() string

func (*ImagePollingJob) Reschedule

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

func (*ImagePollingJob) Run

func (j *ImagePollingJob) Run(ctx context.Context)

func (*ImagePollingJob) Schedule

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

func (*ImagePollingJob) ShouldSchedule added in v1.17.0

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

type JobScheduler

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

func NewJobScheduler

func NewJobScheduler(ctx context.Context, location *time.Location) *JobScheduler

NewJobScheduler creates a new job scheduler with the specified timezone location. The location is used for interpreting cron expressions. If location is nil, UTC is used.

func (*JobScheduler) GetJob

func (js *JobScheduler) GetJob(jobID string) (schedulertypes.Job, bool)

func (*JobScheduler) GetLocation

func (js *JobScheduler) GetLocation() *time.Location

GetLocation returns the timezone location used by the scheduler for cron expressions.

func (*JobScheduler) RegisterJob

func (js *JobScheduler) RegisterJob(job schedulertypes.Job)

func (*JobScheduler) RescheduleJob

func (js *JobScheduler) RescheduleJob(ctx context.Context, job schedulertypes.Job) error

func (*JobScheduler) Run

func (js *JobScheduler) Run(ctx context.Context) error

func (*JobScheduler) StartScheduler

func (js *JobScheduler) StartScheduler()

type PruningVolumeHelperJob added in v1.20.0

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

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

func NewPruningVolumeHelperJob added in v1.20.0

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

func (*PruningVolumeHelperJob) Name added in v1.20.0

func (j *PruningVolumeHelperJob) Name() string

func (*PruningVolumeHelperJob) Reschedule added in v1.20.0

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

func (*PruningVolumeHelperJob) Run added in v1.20.0

func (*PruningVolumeHelperJob) Schedule added in v1.20.0

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 *services.SystemService, settingsService *services.SettingsService, notificationService *services.NotificationService) *ScheduledPruneJob

func (*ScheduledPruneJob) Name

func (j *ScheduledPruneJob) Name() string

func (*ScheduledPruneJob) Reschedule

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

func (*ScheduledPruneJob) Run

func (j *ScheduledPruneJob) Run(ctx context.Context)

func (*ScheduledPruneJob) Schedule

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

func (*ScheduledPruneJob) ShouldSchedule added in v1.17.0

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

type VulnerabilityScanJob

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

VulnerabilityScanJob periodically scans all Docker images for vulnerabilities using Trivy. It is opt-in via the "vulnerabilityScanEnabled" setting.

func NewVulnerabilityScanJob

func NewVulnerabilityScanJob(vulnerabilityService *services.VulnerabilityService, settingsService *services.SettingsService) *VulnerabilityScanJob

NewVulnerabilityScanJob creates a new VulnerabilityScanJob.

func (*VulnerabilityScanJob) Name

func (j *VulnerabilityScanJob) Name() string

func (*VulnerabilityScanJob) Run

func (j *VulnerabilityScanJob) Run(ctx context.Context)

func (*VulnerabilityScanJob) Schedule

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

Schedule returns the cron expression for the job. Defaults to daily at midnight.

func (*VulnerabilityScanJob) ShouldSchedule added in v1.17.0

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

Jump to

Keyboard shortcuts

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