Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AlwaysPinThreshold sets a limit on the contract data of the server. If // the server is below that limit, it will repin underpinned files even if it // is not in the bottom X% in the cluster. AlwaysPinThreshold = build.Select( build.Var{ Standard: 50 * database.TiB, Dev: 1 * database.MiB, Testing: 1 * database.MiB, }).(int) // PinningRangeThresholdPercent defines the cutoff line in the list of // servers, ordered by how much data they are pinning, below which a server // will pin underpinned skylinks. PinningRangeThresholdPercent = 0.30 // RepairDataPinningThreshold sets a limit on the amount of repair data skyd // needs to handle. If skyd needs to repair more than this amount, it won't // pin underpinned skylinks. RepairDataPinningThreshold = uint64(database.TiB) // SleepBetweenHealthChecks defines the wait time between calls to skyd to // check the current health of a given file. SleepBetweenHealthChecks = build.Select( build.Var{ Standard: 5 * time.Second, Dev: time.Second, Testing: time.Millisecond, }).(time.Duration) )
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a background worker that periodically scans the database for underpinned skylinks. Once an underpinned skylink is found (and it's not being pinned by the local server already), Scanner pins it to the local skyd.
func New ¶
func New(db *database.DB, logger logger.Logger, minPinners int, threads int, serverName string, customSleepBetweenScans time.Duration, skydClient skyd.Client) *Scanner
New creates a new Scanner instance.
type Status ¶
type Status struct { InProgress bool `json:"inProgress"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` NumPinned int `json:"numPinned"` NumFailed int `json:"numFailed"` Failed []string `json:"failed,omitempty"` }
Status represents the status of a sweep. All times are UTC-based in order to simplify handling and comparison.
Click to show internal directories.
Click to hide internal directories.