2019-11-05 15:33:44 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package gracefulexit
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2019-11-08 20:40:39 +00:00
|
|
|
"github.com/spacemonkeygo/monkit/v3"
|
2019-11-05 15:33:44 +00:00
|
|
|
"github.com/zeebo/errs"
|
|
|
|
|
2019-12-27 11:48:47 +00:00
|
|
|
"storj.io/common/memory"
|
2019-11-05 15:33:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// Error is the default error class for graceful exit package.
|
|
|
|
Error = errs.Class("gracefulexit")
|
|
|
|
|
|
|
|
mon = monkit.Package()
|
|
|
|
)
|
|
|
|
|
|
|
|
// Config for graceful exit
|
|
|
|
type Config struct {
|
|
|
|
ChoreInterval time.Duration `help:"how often to run the chore to check for satellites for the node to exit." releaseDefault:"15m" devDefault:"10s"`
|
2020-01-24 22:48:08 +00:00
|
|
|
NumWorkers int `help:"number of workers to handle satellite exits" default:"4"`
|
|
|
|
NumConcurrentTransfers int `help:"number of concurrent transfers per graceful exit worker" default:"5"`
|
|
|
|
MinBytesPerSecond memory.Size `help:"the minimum acceptable bytes that an exiting node can transfer per second to the new node" default:"5KB"`
|
2019-11-05 15:33:44 +00:00
|
|
|
MinDownloadTimeout time.Duration `help:"the minimum duration for downloading a piece from storage nodes before timing out" default:"2m"`
|
|
|
|
}
|