retry

package
v0.8.29 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(timeout time.Duration, f func(int) error) (err error)

Retry retries to run the given function until it returns no error. Returns an error after `timeout`. It uses an exponential backoff for retries, with a min of 10ms, max of 5 seconds and a factor of 1.5. Uses jitter to randomize sleep durations, to avoid contention. See more here: github.com/jpillora/backoff If the duration is set to 0, it run the given function once.

Types

This section is empty.

Jump to

Keyboard shortcuts

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