mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
accounting: fix --bwlimit when up or down is off - fixes #5019
Before this change the core bandwidth limit was limited to upload or download value if the other value was off. This fix only applies a core bandwidth limit when both values are set.
This commit is contained in:
parent
e779cacc82
commit
2aebeb6061
@ -68,7 +68,8 @@ func newTokenBucket(bandwidth fs.BwPair) (tbs buckets) {
|
||||
bandwidthAccounting = bandwidth.Rx
|
||||
}
|
||||
}
|
||||
if bandwidthAccounting > 0 {
|
||||
// Limit core bandwidth to max of Rx and Tx if both are limited
|
||||
if bandwidth.Tx > 0 && bandwidth.Rx > 0 {
|
||||
tbs[TokenBucketSlotAccounting] = rate.NewLimiter(rate.Limit(bandwidthAccounting), maxBurstSize)
|
||||
}
|
||||
for _, tb := range tbs {
|
||||
|
Loading…
Reference in New Issue
Block a user