retry

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RetryFetcher

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

RetryFetcher is a decorator that retries transient failures with exponential backoff and jitter before delegating to the wrapped JobFetcher.

func NewRetryFetcher

func NewRetryFetcher(inner model.JobFetcher, maxRetries int, baseDelay time.Duration, logger *slog.Logger) *RetryFetcher

NewRetryFetcher wraps a JobFetcher with retry logic. maxRetries is the number of additional attempts after the first failure (default: 2). baseDelay is the delay before the first retry (default: 5s), doubled on each subsequent retry.

func (*RetryFetcher) FetchJobs

func (f *RetryFetcher) FetchJobs(ctx context.Context) ([]model.Job, error)

FetchJobs attempts to fetch jobs, retrying on transient errors.

Jump to

Keyboard shortcuts

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