redrive

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: BSD-2-Clause Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(
	client vaultapi.Client,
	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