checker

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error = errs.Class("checker error")
)

Error is a standard error class for this package.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	Loop            sync2.Cycle
	IrreparableLoop sync2.Cycle
	// contains filtered or unexported fields
}

Checker contains the information needed to do checks for missing pieces

func NewChecker

func NewChecker(metainfo *metainfo.Service, repairQueue queue.RepairQueue, overlay *overlay.Cache, irrdb irreparable.DB, limit int, logger *zap.Logger, repairInterval, irreparableInterval time.Duration) *Checker

NewChecker creates a new instance of checker

func (*Checker) Close

func (checker *Checker) Close() error

Close halts the Checker loop

func (*Checker) IdentifyInjuredSegments

func (checker *Checker) IdentifyInjuredSegments(ctx context.Context) (err error)

IdentifyInjuredSegments checks for missing pieces off of the metainfo and overlay cache

func (*Checker) IrreparableProcess added in v0.13.0

func (checker *Checker) IrreparableProcess(ctx context.Context) (err error)

IrreparableProcess picks items from irrepairabledb and spawns a repair worker

func (*Checker) Run

func (checker *Checker) Run(ctx context.Context) (err error)

Run the checker loop

type Config

type Config struct {
	Interval            time.Duration `help:"how frequently checker should check for bad segments" releaseDefault:"30s" devDefault:"0h0m10s"`
	IrreparableInterval time.Duration `help:"how frequently irrepairable checker should check for lost pieces" releaseDefault:"30m" devDefault:"0h0m5s"`
}

Config contains configurable values for checker

Jump to

Keyboard shortcuts

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