dbcleanup

package
v1.80.5-rc Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: AGPL-3.0 Imports: 6 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 periodically removes unwanted records from the satellite console database.

func NewChore

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

NewChore creates a new console DB cleanup chore.

func (*Chore) Close

func (chore *Chore) Close() error

Close stops the console DB cleanup chore.

func (*Chore) Run

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

Run runs the console DB cleanup chore.

type Config

type Config struct {
	Enabled  bool          `help:"whether to run this chore" default:"false"`
	Interval time.Duration `help:"interval between chore cycles" default:"24h"`

	AsOfSystemTimeInterval time.Duration `` /* 150-byte string literal not displayed */
	PageSize               int           `help:"maximum number of database records to scan at once" default:"1000"`

	MaxUnverifiedUserAge    time.Duration `help:"maximum lifetime of unverified user account records" default:"168h"`
	MaxProjectInvitationAge time.Duration `help:"maximum lifetime of project member invitation records" default:"168h"`
}

Config contains the configuration for the console DB cleanup chore.

Jump to

Keyboard shortcuts

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