dbcleanup

package
v1.19.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error the default dbcleanup errs class.
	Error = errs.Class("dbcleanup error")
)

Functions

This section is empty.

Types

type Chore

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

Chore for deleting DB entries that are no longer needed.

architecture: Chore

func NewChore

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

NewChore creates new chore for deleting DB entries.

func (*Chore) Close

func (chore *Chore) Close() error

Close stops the dbcleanup chore.

func (*Chore) Run

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

Run starts the db cleanup chore.

type Config

type Config struct {
	SerialsInterval time.Duration `help:"how often to delete expired serial numbers" default:"4h"`
	BatchSize       int           `` /* 126-byte string literal not displayed */
}

Config defines configuration struct for dbcleanup chore.

Jump to

Keyboard shortcuts

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