cleanup

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chore

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

Chore to remove old token prices.

architecture: Chore

func NewChore

func NewChore(log *zap.Logger, db tokenprice.PriceQuoteDB, config Config) *Chore

NewChore creates new chore for removing old token prices.

func (*Chore) Close

func (chore *Chore) Close() error

Close stops the chore.

func (*Chore) Run

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

Run starts the chore.

func (*Chore) RunOnce

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

RunOnce removes old token prices.

type Config

type Config struct {
	Interval   time.Duration `help:"how often to remove old token prices" default:"336h" testDefault:"$TESTINTERVAL"`
	RetainDays int           `help:"number of days of token prices to retain" default:"30"`
}

Config is a configuration struct for the Chore.

Jump to

Keyboard shortcuts

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