mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 05:33:11 +08: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 (
|
var (
|
||||||
// Flags
|
// Flags
|
||||||
cpuprofile = pflag.StringP("cpuprofile", "", "", "Write cpu profile to file")
|
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")
|
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
|
// Print the stats every statsInterval
|
||||||
func StartStats() {
|
func StartStats() {
|
||||||
|
if *statsInterval <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
go func() {
|
go func() {
|
||||||
ch := time.Tick(*statsInterval)
|
ch := time.Tick(*statsInterval)
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user