backoff

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultDuration is the default duration between repairs.
	DefaultDuration = 4 * time.Minute
	// DefaultTimeout is the default timeout that's applied when we want to stop the repairs for a while.
	DefaultTimeout = 1 * time.Hour
)

Functions

This section is empty.

Types

type B

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

func New

func New(d time.Duration) *B

func (*B) Done

func (b *B) Done()

Done is called when a repair is done (either failed or not), and sets various timestamp and counters, so that we don't repeatly repair things that can't be repaired.

func (*B) Next

func (b *B) Next() time.Time

func (*B) OK

func (b *B) OK() bool

OK returns true when we are allowed to start a repair. It's assumed OK will be called first before any Done.

Jump to

Keyboard shortcuts

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