Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix readme and account refill interval consistency #1757

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: major
---

# Make naming for accountRefillInterval consistent in config
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ overview of all settings configurable through the CLI.
| `Bus.RemotePassword` | Remote password for the bus | - | - | `RENTERD_BUS_API_PASSWORD` | `bus.remotePassword` |
| `Bus.UsedUTXOExpiry` | Expiry for used UTXOs in transactions | `24h` | `--bus.usedUTXOExpiry` | - | `bus.usedUtxoExpiry` |
| `Bus.SlabBufferCompletionThreshold` | Threshold for slab buffer upload | `4096` | `--bus.slabBufferCompletionThreshold` | `RENTERD_BUS_SLAB_BUFFER_COMPLETION_THRESHOLD` | `bus.slabBufferCompletionThreshold` |
| `Worker.AccountRefillInterval` | Interval for refilling workers' account balances | `10s` | `--worker.accountRefillInterval` | - | `worker.accountRefillInterval` |
| `Worker.BusFlushInterval` | Interval for flushing data to bus | `5s` | `--worker.busFlushInterval` | - | `worker.busFlushInterval` |
| `Worker.DownloadMaxOverdrive` | Max overdrive workers for downloads | `5` | `--worker.downloadMaxOverdrive` | - | `worker.downloadMaxOverdrive` |
| `Worker.DownloadMaxMemory` | Max memory for downloads | `1GiB` | `--worker.downloadMaxMemory` | `RENTERD_WORKER_DOWNLOAD_MAX_MEMORY` | `worker.downloadMaxMemory` |
Expand Down
11 changes: 5 additions & 6 deletions cmd/renterd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ func defaultConfig() config.Config {
SlabBufferCompletionThreshold: 1 << 12,
},
Worker: config.Worker{
Enabled: true,

ID: "",
AccountsRefillInterval: defaultAccountRefillInterval,
BusFlushInterval: 5 * time.Second,
Enabled: true,
ID: "",
AccountRefillInterval: defaultAccountRefillInterval,
BusFlushInterval: 5 * time.Second,

DownloadMaxOverdrive: 5,
DownloadOverdriveTimeout: 3 * time.Second,
Expand Down Expand Up @@ -281,7 +280,7 @@ func parseCLIFlags(cfg *config.Config) {
flag.Int64Var(&cfg.Bus.SlabBufferCompletionThreshold, "bus.slabBufferCompletionThreshold", cfg.Bus.SlabBufferCompletionThreshold, "Threshold for slab buffer upload (overrides with RENTERD_BUS_SLAB_BUFFER_COMPLETION_THRESHOLD)")

// worker
flag.DurationVar(&cfg.Worker.AccountsRefillInterval, "worker.accountRefillInterval", cfg.Worker.AccountsRefillInterval, "Interval for refilling workers' account balances")
flag.DurationVar(&cfg.Worker.AccountRefillInterval, "worker.accountRefillInterval", cfg.Worker.AccountRefillInterval, "Interval for refilling workers' account balances")
flag.DurationVar(&cfg.Worker.BusFlushInterval, "worker.busFlushInterval", cfg.Worker.BusFlushInterval, "Interval for flushing data to bus")
flag.Uint64Var(&cfg.Worker.DownloadMaxMemory, "worker.downloadMaxMemory", cfg.Worker.DownloadMaxMemory, "Max amount of RAM the worker allocates for slabs when downloading (overrides with RENTERD_WORKER_DOWNLOAD_MAX_MEMORY)")
flag.Uint64Var(&cfg.Worker.DownloadMaxOverdrive, "worker.downloadMaxOverdrive", cfg.Worker.DownloadMaxOverdrive, "Max overdrive workers for downloads")
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ type (
Worker struct {
Enabled bool `yaml:"enabled,omitempty"`
ID string `yaml:"id,omitempty"`
AccountsRefillInterval time.Duration `yaml:"accountsRefillInterval,omitempty"`
AccountRefillInterval time.Duration `yaml:"accountRefillInterval,omitempty"`
BusFlushInterval time.Duration `yaml:"busFlushInterval,omitempty"`
DownloadOverdriveTimeout time.Duration `yaml:"downloadOverdriveTimeout,omitempty"`
UploadOverdriveTimeout time.Duration `yaml:"uploadOverdriveTimeout,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion internal/test/e2e/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ func testDBCfg() dbConfig {

func testWorkerCfg() config.Worker {
return config.Worker{
AccountsRefillInterval: 10 * time.Millisecond,
AccountRefillInterval: 10 * time.Millisecond,
ID: "worker",
BusFlushInterval: testBusFlushInterval,
DownloadOverdriveTimeout: 500 * time.Millisecond,
Expand Down
2 changes: 1 addition & 1 deletion worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ func New(cfg config.Worker, masterKey [32]byte, b Bus, l *zap.Logger) (*Worker,
shutdownCtxCancel: shutdownCancel,
}

if err := w.initAccounts(cfg.AccountsRefillInterval); err != nil {
if err := w.initAccounts(cfg.AccountRefillInterval); err != nil {
return nil, fmt.Errorf("failed to initialize accounts; %w", err)
}

Expand Down
2 changes: 1 addition & 1 deletion worker/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (w *testWorker) UsableHosts() []api.HostInfo {

func newTestWorkerCfg() config.Worker {
return config.Worker{
AccountsRefillInterval: time.Second,
AccountRefillInterval: time.Second,
ID: "test",
BusFlushInterval: time.Second,
DownloadOverdriveTimeout: time.Second,
Expand Down
Loading