Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cleanup ¶
type Cleanup struct {
// contains filtered or unexported fields
}
Cleanup is a service, which combines retain,TTL,trash, and runs only once (if load is not too high).
func NewCleanup ¶
func NewCleanup(log *zap.Logger, loop *SafeLoop, blobs blobstore.Blobs, pieces *pieces.Store, usedSerials *usedserials.Table, config collector.Config) *Cleanup
NewCleanup creates a new Cleanup.
func (*Cleanup) EmptyTrash ¶
EmptyTrash removes all the trashed pieces, which are older than the trashExpiryInterval.
func (*Cleanup) RunCollector ¶
RunCollector runs the collector.
type CoreLoad ¶
type CoreLoad struct {
// contains filtered or unexported fields
}
CoreLoad is an availability check which is false if load/core is high.
func NewCoreLoad ¶
func NewCoreLoad(config CoreLoadConfig) *CoreLoad
NewCoreLoad creates a new CoreLoad.
type CoreLoadConfig ¶
type CoreLoadConfig struct {
MaxCoreLoad float64 `help:"max Linux load / core for executing background jobs. Jobs will be cancelled if load is higher" default:"10"`
}
CoreLoadConfig is the configuration for core load.
type Enablement ¶
Enablement checks if we have free resources to run background jobs.
type FileExists ¶
type FileExists struct {
Path string
}
FileExists is an availability check which is false if file exists.
func NewFileExists ¶
func NewFileExists(config FileExistsConfig) *FileExists
NewFileExists creates a new FileExists.
func (*FileExists) Enabled ¶
func (f *FileExists) Enabled() (bool, error)
Enabled implements Enablement.
type FileExistsConfig ¶
type FileExistsConfig struct {
Path string `help:"path to the file. Cleanup will be stopped if file exists" default:"/tmp/storj.chore.disable"`
}
FileExistsConfig contains the configuration for FileExists.
type Period ¶
type Period struct {
// contains filtered or unexported fields
}
Period is an availability check which is false if the current time is outside the configured period.
type PeriodConfig ¶
type PeriodConfig struct { FromHour int `usage:"hour to start cleanup" default:"0"` ToHour int `usage:"hour to stop cleanup" default:"24"` }
PeriodConfig contains the configuration for Period.
type SafeLoop ¶
type SafeLoop struct {
// contains filtered or unexported fields
}
SafeLoop is an execution.
func NewSafeLoop ¶
func NewSafeLoop(log *zap.Logger, availability []Enablement, cfg SafeLoopConfig) *SafeLoop
NewSafeLoop creates a new SafeLoop.