1
mirror of https://github.com/rclone/rclone synced 2024-11-30 09:10:05 +01:00

sync: allow --max-backlog to be -ve meaning as large as possible

This commit is contained in:
Nick Craig-Wood 2020-05-15 11:23:16 +01:00
parent 7f44735709
commit 147f97d1f7
2 changed files with 7 additions and 0 deletions

View File

@ -745,6 +745,9 @@ time and make `--order-by` work more accurately.
Setting this small will make rclone more synchronous to the listings
of the remote which may be desirable.
Setting this to a negative number will make the backlog as large as
possible.
### --max-delete=N ###
This tells rclone not to delete more than N files. If that limit is

View File

@ -2,6 +2,7 @@ package sync
import (
"context"
"math/bits"
"strconv"
"strings"
"sync"
@ -30,6 +31,9 @@ type pipe struct {
}
func newPipe(orderBy string, stats func(items int, totalSize int64), maxBacklog int) (*pipe, error) {
if maxBacklog < 0 {
maxBacklog = (1 << (bits.UintSize - 1)) - 1 // largest posititive int
}
less, fraction, err := newLess(orderBy)
if err != nil {
return nil, fserrors.FatalError(err)