retry

package
v0.0.0-...-9e55092 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Try

func Try(ctx context.Context, f func() error, attempts int, delay time.Duration) (err error)

Try runs the f function until it returns nil but not more than defined in the attempts argument. After reaching the max attempts, it returns the last error. The delay argument defines the time between each attempt. If the context is canceled, the function stops and returns the error.

func TryForever

func TryForever(ctx context.Context, f func() error, delay time.Duration)

TryForever runs the f function until it returns nil or the context is canceled. The delay argument defines the time between each attempt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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