scheduler

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: BSD-3-Clause Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const ActivitySweepJobName = "activity-sweep"
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

func NewJobScheduler

func NewJobScheduler(ctx context.Context, runtime *actors.Runtime, location *time.Location) (schedulertypes.JobScheduler, error)

NewJobScheduler creates an actor-owned scheduler control plane.

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 *services.ActivityService) *ActivitySweepJob

func (*ActivitySweepJob) Name added in v2.6.0

func (j *ActivitySweepJob) Name() string

func (*ActivitySweepJob) Run added in v2.6.0

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

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 *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

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

func NewAutoHealJob

func NewAutoHealJob(
	dockerClientService *services.DockerClientService,
	settingsService *services.SettingsService,
	eventService *services.EventService,
	notificationService *services.NotificationService,
	admissionGate *actors.Gate[actors.AdmissionKey],
) (*AutoHealJob, error)

func (*AutoHealJob) CanRestartExported

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

CanRestartExported exposes canRestart for testing.

func (*AutoHealJob) Name

func (j *AutoHealJob) Name() string

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 (j *AutoHealJob) Run(ctx context.Context)

func (*AutoHealJob) Schedule

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

func (*AutoHealJob) ShouldSchedule

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, admissionGate *actors.Gate[actors.AdmissionKey]) (*AutoUpdateJob, error)

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

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

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 *services.DockerClientService, settingsService *services.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 *services.EventService, activityService *services.ActivityService, 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

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

func NewExpiredSessionsCleanupJob

func NewExpiredSessionsCleanupJob(sessionService *services.SessionService, settingsService *services.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,
	actorRuntime *actors.Runtime,
	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

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

func (*FilesystemWatcherJob) Start

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

func (*FilesystemWatcherJob) Stop

type ImageUpdateWatcher added in v2.5.0

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

ImageUpdateWatcher continuously reconciles image update state after Docker image changes.

func NewImageUpdateWatcher added in v2.5.0

func NewImageUpdateWatcher(runtime *actors.Runtime, cfg *config.Config, imageUpdateService *services.ImageUpdateService, settingsService *services.SettingsService, environmentService *services.EnvironmentService, dockerService *services.DockerClientService, projectService *services.ProjectService) (*ImageUpdateWatcher, error)

NewImageUpdateWatcher constructs the image update watcher from the existing services.

func (*ImageUpdateWatcher) Name added in v2.5.0

func (w *ImageUpdateWatcher) Name() string

Name identifies the watcher in scheduler lifecycle logs.

func (*ImageUpdateWatcher) RefreshSchedule added in v2.5.0

func (w *ImageUpdateWatcher) RefreshSchedule()

RefreshSchedule wakes the actor so it re-reads pollingInterval.

func (*ImageUpdateWatcher) RunNow added in v2.5.0

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

RunNow requests immediate admission from the watcher actor and waits for that scan. An active scan is refused immediately instead of being queued.

func (*ImageUpdateWatcher) Start added in v2.5.0

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

Start subscribes to Docker image events and owns the watcher actor until ctx is canceled.

func (*ImageUpdateWatcher) Stop added in v2.7.0

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

Stop terminates the watcher actor within the caller's lifecycle deadline.

func (*ImageUpdateWatcher) Trigger added in v2.5.0

func (w *ImageUpdateWatcher) Trigger()

Trigger records a trailing-edge image scan without blocking the event publisher.

type PruningVolumeHelperJob

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

func NewPruningVolumeHelperJob(volumeService *services.VolumeService, settingsService *services.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 *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

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

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