maintenance

package
v14.1.0-rc42 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DailyWorker

type DailyWorker struct {
	// contains filtered or unexported fields
}

DailyWorker allows for a storage job to be executed on a daily schedule

func NewDailyWorker

func NewDailyWorker() DailyWorker

NewDailyWorker returns an initialized daily worker

func (DailyWorker) StartDaily

func (dw DailyWorker) StartDaily(ctx context.Context, l logrus.FieldLogger, schedule config.DailyJob, job StoragesJob) error

StartDaily will run the provided job every day at the specified time for the specified duration. Only the specified storages wil be worked on.

type Optimizer

type Optimizer interface {
	OptimizeRepository(context.Context, *gitalypb.OptimizeRepositoryRequest, ...grpc.CallOption) (*gitalypb.OptimizeRepositoryResponse, error)
}

Optimizer knows how to optimize a repository

type StoragesJob

type StoragesJob func(context.Context, logrus.FieldLogger, []string) error

StoragesJob runs a job on storages. The string slice param indicates which storages are currently enabled for the feature.

func OptimizeReposRandomly

func OptimizeReposRandomly(storages []config.Storage, optimizer Optimizer, ticker helper.Ticker, rand *rand.Rand) StoragesJob

OptimizeReposRandomly returns a function to walk through each storage and attempts to optimize any repos encountered. The ticker is used to rate-limit optimizations.

Only storage paths that map to an enabled storage name will be walked. Any storage paths shared by multiple storages will only be walked once.

Any errors during the optimization will be logged. Any other errors will be returned and cause the walk to end prematurely.

Jump to

Keyboard shortcuts

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