32 lines
788 B
Go
32 lines
788 B
Go
|
// Copyright (C) 2018 Storj Labs, Inc.
|
||
|
// See LICENSE for copying information.
|
||
|
|
||
|
package checker
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"time"
|
||
|
|
||
|
"storj.io/storj/pkg/provider"
|
||
|
)
|
||
|
|
||
|
// Config contains configurable values for repairer
|
||
|
type Config struct {
|
||
|
QueueAddress string `help:"data repair queue address" default:"redis://localhost:6379?db=5&password=123"`
|
||
|
Interval time.Duration `help:"how frequently checker should audit segments" default:"30s"`
|
||
|
}
|
||
|
|
||
|
// Initialize a Checker struct
|
||
|
func (c Config) initialize(ctx context.Context) (Checker, error) {
|
||
|
return &checker{}, nil
|
||
|
}
|
||
|
|
||
|
// Run runs the checker with configured values
|
||
|
func (c Config) Run(ctx context.Context, server *provider.Provider) (err error) {
|
||
|
check, err := c.initialize(ctx)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return check.Run()
|
||
|
}
|