mirror of
https://github.com/rclone/rclone.git
synced 2024-11-28 19:34:55 +01:00
Make it possible to disable stats printing with --stats=0
This commit is contained in:
parent
85f8552c4d
commit
e89ea3360e
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user