mirror of
https://github.com/restic/restic.git
synced 2025-12-04 13:03:46 +00:00
Count errors separately and not as files that are "done"
This commit is contained in:
16
progress.go
16
progress.go
@@ -24,11 +24,12 @@ type Progress struct {
|
||||
}
|
||||
|
||||
type Stat struct {
|
||||
Files uint64
|
||||
Dirs uint64
|
||||
Bytes uint64
|
||||
Trees uint64
|
||||
Blobs uint64
|
||||
Files uint64
|
||||
Dirs uint64
|
||||
Bytes uint64
|
||||
Trees uint64
|
||||
Blobs uint64
|
||||
Errors uint64
|
||||
}
|
||||
|
||||
type ProgressFunc func(s Stat, runtime time.Duration, ticker bool)
|
||||
@@ -173,6 +174,7 @@ func (s *Stat) Add(other Stat) {
|
||||
s.Files += other.Files
|
||||
s.Trees += other.Trees
|
||||
s.Blobs += other.Blobs
|
||||
s.Errors += other.Errors
|
||||
}
|
||||
|
||||
func (s Stat) String() string {
|
||||
@@ -192,6 +194,6 @@ func (s Stat) String() string {
|
||||
str = fmt.Sprintf("%dB", s.Bytes)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("Stat(%d files, %d dirs, %v trees, %v blobs, %v)",
|
||||
s.Files, s.Dirs, s.Trees, s.Blobs, str)
|
||||
return fmt.Sprintf("Stat(%d files, %d dirs, %v trees, %v blobs, %d errors, %v)",
|
||||
s.Files, s.Dirs, s.Trees, s.Blobs, s.Errors, str)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user