retrypolicy

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package retrypolicy contains River's internal retry policy implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelayBounds added in v0.50.0

func DelayBounds(errorCount int) (time.Duration, time.Duration)

DelayBounds returns the smallest and largest delay NextRetryAt schedules for a job with errorCount-1 recorded errors. Delays are errorCount^4 seconds with up to 10% jitter either way, capped at the maximum time.Duration.

func NextRetryAt

func NextRetryAt(now time.Time, job *rivertype.JobRow) time.Time

NextRetryAt calculates when the next retry for a failed job should take place relative to now.

Types

type Default

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

Default is River's clock-aware default retry policy for internal use.

func NewDefault

func NewDefault(timeGenerator rivertype.TimeGenerator) *Default

NewDefault returns a default retry policy that derives retries from the given time generator.

func (*Default) NextRetry

func (p *Default) NextRetry(job *rivertype.JobRow) time.Time

NextRetry calculates when the next retry for a failed job should take place.

Jump to

Keyboard shortcuts

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