fs: fix crash when --low-level-retries=0 - fixes #5024
This commit is contained in:
parent
3cf6ea848b
commit
301e1ad982
1 changed files with 7 additions and 2 deletions
9
fs/fs.go
9
fs/fs.go
|
@ -1449,11 +1449,16 @@ type logCalculator struct {
|
|||
|
||||
// NewPacer creates a Pacer for the given Fs and Calculator.
|
||||
func NewPacer(ctx context.Context, c pacer.Calculator) *Pacer {
|
||||
ci := GetConfig(ctx)
|
||||
retries := ci.LowLevelRetries
|
||||
if retries <= 0 {
|
||||
retries = 1
|
||||
}
|
||||
p := &Pacer{
|
||||
Pacer: pacer.New(
|
||||
pacer.InvokerOption(pacerInvoker),
|
||||
pacer.MaxConnectionsOption(GetConfig(ctx).Checkers+GetConfig(ctx).Transfers),
|
||||
pacer.RetriesOption(GetConfig(ctx).LowLevelRetries),
|
||||
pacer.MaxConnectionsOption(ci.Checkers+ci.Transfers),
|
||||
pacer.RetriesOption(retries),
|
||||
pacer.CalculatorOption(c),
|
||||
),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue