added Stats.Reset()

This commit is contained in:
Jarek Kowalski
2016-10-23 14:48:23 -07:00
parent a821a0053d
commit 4206d6ecbe
2 changed files with 6 additions and 0 deletions

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 {

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{}
}