zombiedeletion

package
v1.70.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package zombiedeletion contains the functions needed to run zombie objects deletion chore.

The zombiedeletion chore will periodically query metabase for zombie objects and delete them with their segments.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error defines the zombiedeletion chore errors class.
	Error = errs.Class("zombie deletion chore")
)

Functions

This section is empty.

Types

type Chore

type Chore struct {
	Loop *sync2.Cycle
	// contains filtered or unexported fields
}

Chore implements the zombie objects cleanup chore.

architecture: Chore

func NewChore

func NewChore(log *zap.Logger, config Config, metabase *metabase.DB) *Chore

NewChore creates a new instance of the zombiedeletion chore.

func (*Chore) Close

func (chore *Chore) Close() error

Close stops the zombiedeletion chore.

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context) (err error)

Run starts the zombiedeletion loop service.

func (*Chore) TestingSetNow

func (chore *Chore) TestingSetNow(nowFn func() time.Time)

TestingSetNow allows tests to have the server act as if the current time is whatever they want.

type Config

type Config struct {
	Interval    time.Duration `help:"the time between each attempt to go through the db and clean up zombie objects" releaseDefault:"12h" devDefault:"10s"`
	Enabled     bool          `help:"set if zombie object cleanup is enabled or not" default:"true"`
	ListLimit   int           `help:"how many objects to query in a batch" default:"100"`
	InactiveFor time.Duration `help:"after what time object will be deleted if there where no new upload activity" default:"24h"`
}

Config contains configurable values for zombie object cleanup.

Jump to

Keyboard shortcuts

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