retry

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefTimeout = 24 * time.Hour

DefTimeout is used as timeout for runs when the passed context has no deadline set.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retryer

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

Retryer executes a function repeatedly until it was successful or it's context was cancelled.

func NewRetryer

func NewRetryer() *Retryer

func (*Retryer) Run

func (r *Retryer) Run(ctx context.Context, fn func(context.Context) error, logF []zap.Field) error

Run executes fn until it was successful, it returned an error that does not wrap goorderr.RetryableError or the execution was aborted via the context. If the context has no deadline set, it will be set to DefTimeout.

func (*Retryer) Stop

func (r *Retryer) Stop()

Stop notifies all Run() methods to terminate. It does not wait for their termination.

Jump to

Keyboard shortcuts

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