mirror of
https://github.com/rclone/rclone
synced 2024-11-26 04:07:22 +01:00
fs: fix crash when --low-level-retries=0 - fixes #5024
This commit is contained in:
parent
3cf6ea848b
commit
301e1ad982
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 New Issue
Block a user