aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drive/util.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/drive/util.go b/drive/util.go
index 366f32b..4103b9d 100644
--- a/drive/util.go
+++ b/drive/util.go
@@ -150,8 +150,10 @@ func (self *Progress) Read(p []byte) (int, error) {
newProgress := self.progress + int64(n)
self.progress = newProgress
+ // Initialize rate state
if self.rateUpdated.IsZero() {
self.rateUpdated = now
+ self.rateProgress = newProgress
}
// Update rate every 3 seconds