cmd: refactor --retries and --retries-sleep to global config

This change moves the --retries and --retries-sleep flags/variables from cmd to
config (consistent with --low-level-retries), so that they can be more easily
referenced from subcommands.
This commit is contained in:
nielash
2024-02-11 22:34:25 -05:00
parent b14269fd23
commit 407a0f3733
3 changed files with 20 additions and 18 deletions

View File

@@ -72,8 +72,10 @@ type ConfigInfo struct {
DeleteMode DeleteMode
MaxDelete int64
MaxDeleteSize SizeSuffix
TrackRenames bool // Track file renames.
TrackRenamesStrategy string // Comma separated list of strategies used to track renames
TrackRenames bool // Track file renames.
TrackRenamesStrategy string // Comma separated list of strategies used to track renames
Retries int // High-level retries
RetriesInterval time.Duration // --retries-sleep
LowLevelRetries int
UpdateOlder bool // Skip files that are newer on the destination
NoGzip bool // Disable compression
@@ -171,6 +173,7 @@ func NewConfig() *ConfigInfo {
c.DeleteMode = DeleteModeDefault
c.MaxDelete = -1
c.MaxDeleteSize = SizeSuffix(-1)
c.Retries = 3
c.LowLevelRetries = 10
c.MaxDepth = -1
c.DataRateUnit = "bytes"