retry

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

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

Retry 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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