retrypolicy

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MPL-2.0 Imports: 5 Imported by: 0 modules, 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

Overview

Package retrypolicy contains River's internal retry policy implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelayBounds

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