job

package
v0.0.0-...-19d8ef3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLocalQuarantinedReplayUnsupported = errors.New("replay requires the descriptor-aware executor")

ErrLocalQuarantinedReplayUnsupported is returned when a quarantined replay reaches the in-process executor, which is not descriptor-aware.

Functions

func EnumerateLogicalDates

func EnumerateLogicalDates(schedule cron.Schedule, start, end time.Time, loc *time.Location) []time.Time

EnumerateLogicalDates returns all cron fire times in [start, end). loc sets the timezone used when computing schedule boundaries; pass time.UTC when the trigger has no timezone configured.

func FilterDates

func FilterDates(store *backfillstore.Store, jobID uuid.UUID, dates []time.Time, reprocess string) ([]time.Time, error)

FilterDates filters logical dates based on the reprocess policy:

"none"   — skip dates that have any existing run
"failed" — skip dates whose latest run succeeded
"all"    — keep all dates

func RunBackfill

func RunBackfill(
	ctx context.Context,
	b *models.Backfill,
	j *models.Job,
	schedule cron.Schedule,
	loc *time.Location,
)

RunBackfill executes a backfill by enumerating logical dates, filtering by the reprocess policy, and running each date through the standard job executor with a semaphore controlling max concurrency.

It honours ctx cancellation: when cancelled, no new runs are started but any in-flight runs are allowed to finish.

Types

type Job

type Job interface {
	Run(ctx context.Context) error
}

Job

func New

func New(m *models.Job, opts ...JobOption) Job

type JobOption

type JobOption func(*job)

JobOption configures a job before execution.

func WithAtomPollInterval

func WithAtomPollInterval(interval time.Duration) JobOption

WithAtomPollInterval overrides the polling interval for atom completion checks.

func WithAtomServiceFactory

func WithAtomServiceFactory(factory func(context.Context) asvc.Atom) JobOption

WithAtomServiceFactory overrides the atom service used to look up atoms.

func WithDispatchRunCallbacks

func WithDispatchRunCallbacks(dispatch func(context.Context, uuid.UUID, uuid.UUID, error) error) JobOption

WithDispatchRunCallbacks overrides the callback dispatch function.

func WithDockerEngineFactory

func WithDockerEngineFactory(factory func(context.Context) atom.Engine) JobOption

WithDockerEngineFactory overrides the Docker engine constructor.

func WithEnvVariables

func WithEnvVariables(variables func() env.Environment) JobOption

WithEnvVariables overrides the environment configuration.

func WithKubernetesEngineFactory

func WithKubernetesEngineFactory(factory func(context.Context) atom.Engine) JobOption

WithKubernetesEngineFactory overrides the Kubernetes engine constructor.

func WithParams

func WithParams(params map[string]string) JobOption

WithParams attaches run parameters to the job. Parameters are injected into each task's environment as CAESIUM_PARAM_<KEY>=<VALUE> (KEY uppercased).

func WithPodmanEngineFactory

func WithPodmanEngineFactory(factory func(context.Context) atom.Engine) JobOption

WithPodmanEngineFactory overrides the Podman engine constructor.

func WithPriorityOverride

func WithPriorityOverride(priority string) JobOption

func WithRunStoreFactory

func WithRunStoreFactory(factory func() *run.Store) JobOption

WithRunStoreFactory overrides the run store used for execution state.

func WithSecretResolver

func WithSecretResolver(resolver secret.Resolver) JobOption

WithSecretResolver configures secret:// resolution for step environment values. If omitted, Run builds the resolver from the processed environment.

func WithTaskEdgeServiceFactory

func WithTaskEdgeServiceFactory(factory func(context.Context) taskedge.TaskEdge) JobOption

WithTaskEdgeServiceFactory overrides the task edge service used to look up edges.

func WithTaskServiceFactory

func WithTaskServiceFactory(factory func(context.Context) task.Task) JobOption

WithTaskServiceFactory overrides the task service used to look up tasks.

func WithTriggerID

func WithTriggerID(id *uuid.UUID) JobOption

Jump to

Keyboard shortcuts

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