Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Only start bandwidth ticker when necessary.

Marco Paganini6611d92e218d
diff --git a/fs/accounting.go b/fs/accounting.go
index 5f6b18b21..4b9475048 100644
--- a/fs/accounting.go
+++ b/fs/accounting.go
@@ -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 {