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

redrive

package
v0.26.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedriveSweep

type RedriveSweep interface {
	// Run blocks until ctx is cancelled, sweeping once per interval.
	Run(ctx context.Context) error
	// SweepOnce performs a single sweep pass. Exposed for unit tests so they do
	// not have to manage tickers. Returns an error only on git/pull failures;
	// per-task errors are logged.
	SweepOnce(ctx context.Context) error
}

RedriveSweep is a background loop that force re-publishes TaskUpdated events for eligible tasks that have never spawned a Job. The change-detecting scanner only emits an event when a task file's content hash changes; a task that sits unchanged since creation (e.g. a stub a collector wrote and then went quiet on) never produces a new event, so the executor — purely event-driven — never re-evaluates it. This sweep is the re-drive path: a task matching the executor's spawn filter but with no current_job (never spawned) gets its TaskUpdated re-emitted on a schedule, and the executor's own guards (active job, trigger cap, grace window) decide whether a spawn actually happens.

func NewRedriveSweep

func NewRedriveSweep(
	gitClient gitrestclient.GitClient,
	publisher publisher.TaskPublisher,
	taskDir string,
	branch base.Branch,
	interval time.Duration,
	currentDateTime libtime.CurrentDateTimeGetter,
	m metrics.Metrics,
) RedriveSweep

NewRedriveSweep creates a RedriveSweep. The backoff for re-emitting the same task is the sweep interval itself, so an eligible task that cannot spawn (executor down, config missing) produces at most one event per interval rather than a flood.

Jump to

Keyboard shortcuts

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