recovery

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package recovery reconciles expired runtime leases into fenced retries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithParallelism

func WithParallelism(workers int) func(*Controller)

WithParallelism bounds concurrent per-candidate recovery within one batch (default 4; 1 = serial).

Types

type Controller

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

func NewController

func NewController(repository Repository, batch int, leaseTTL time.Duration) *Controller

func (*Controller) Reconcile

func (c *Controller) Reconcile(ctx context.Context) (int, error)

Reconcile recovers expired attempts. Transient transaction conflicts are retried with bounded backoff (ADR-002).

type Repository

type Repository interface {
	ListExpiredAttempts(context.Context, time.Time, int) ([]store.RecoveryCandidate, error)
	RecoverExpiredAttempt(context.Context, store.RecoverExpiredAttemptInput) (store.RecoveryResult, error)
}

Jump to

Keyboard shortcuts

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