added Stats.Reset()

This commit is contained in:
Jarek Kowalski committed 2016-10-23 14:48:23 -07:00
1 parent a821a0053d
commit 4206d6ecbe
2 files changed
+6

No files matched your search

+1
View File
@@ -70,6 +70,7 @@ func runBackupCommand(c *kingpin.ParseContext) error {
}
for _, backupDirectory := range sources {
conn.Repository.Stats.Reset()
log.Printf("Backing up %v", backupDirectory)
dir, err := filepath.Abs(backupDirectory)
if err != nil {
+5
View File
@@ -18,3 +18,8 @@ type Stats struct {
PresentBlocks int32 `json:"presentBlocks,omitempty"`
ValidBlocks int32 `json:"validBlocks,omitempty"`
}
// Reset clears all repository statistics.
func (s *Stats) Reset() {
*s = Stats{}
}