backoff

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package backoff provides a tool for repeatedly calling a function until it returns a nil error. It implements exponential backoff with a defined maximum value, along with some time randomization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(f func() error, initialBackoff, maxBackoff time.Duration, label string)

Retry retries calling a function until the function returns a non-nil error. It increments two prometheus counters to keep track of how many errors it has seen: one for all errors, and just when the max error count has been reached. The counters are indexed by the passed-in label. For best results, make sure that maxBackoff > 2*initialBackoff.

Types

This section is empty.

Jump to

Keyboard shortcuts

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