mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 00:43:49 +01:00
Only start bandwidth ticker when necessary.
- Only start the token ticker when the timetable entry has more than one entry. - This fixes the "Scheduled bandwidth change" log message when no bwlimit is specified. - Fixes #987
This commit is contained in:
parent
e1a49ca426
commit
6611d92e21
@ -43,6 +43,12 @@ func startTokenBucket() {
|
||||
|
||||
// startTokenTicker creates a ticker to update the bandwidth limiter every minute.
|
||||
func startTokenTicker() {
|
||||
// If the timetable has a single entry or was not specified, we don't need
|
||||
// a ticker to update the bandwidth.
|
||||
if len(bwLimit) <= 1 {
|
||||
return
|
||||
}
|
||||
|
||||
ticker := time.NewTicker(time.Minute)
|
||||
go func() {
|
||||
for range ticker.C {
|
||||
|
Loading…
Reference in New Issue
Block a user