From e89ea3360eb6b37481349fdd3bf7342488c37611 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 27 Feb 2015 15:22:26 +0000 Subject: [PATCH] Make it possible to disable stats printing with --stats=0 --- rclone.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rclone.go b/rclone.go index 6f894db06..1ae464e43 100644 --- a/rclone.go +++ b/rclone.go @@ -28,7 +28,7 @@ import ( var ( // Flags cpuprofile = pflag.StringP("cpuprofile", "", "", "Write cpu profile to file") - statsInterval = pflag.DurationP("stats", "", time.Minute*1, "Interval to print stats") + statsInterval = pflag.DurationP("stats", "", time.Minute*1, "Interval to print stats (0 to disable)") version = pflag.BoolP("version", "V", false, "Print the version number") ) @@ -323,6 +323,9 @@ func NewFs(remote string) fs.Fs { // Print the stats every statsInterval func StartStats() { + if *statsInterval <= 0 { + return + } go func() { ch := time.Tick(*statsInterval) for {