restorer: separately track skipped files

This commit is contained in:
Michael Eischer committed 2024-06-12 22:36:52 +02:00
1 parent 64b7b6b975
commit e47e08a688
8 files changed
+94 -30

No files matched your search

+14
View File
@@ -10,8 +10,10 @@ import (
type State struct {
FilesFinished uint64
FilesTotal uint64
FilesSkipped uint64
AllBytesWritten uint64
AllBytesTotal uint64
AllBytesSkipped uint64
}
type Progress struct {
@@ -97,6 +99,18 @@ func (p *Progress) AddProgress(name string, bytesWrittenPortion uint64, bytesTot
}
}
func (p *Progress) AddSkippedFile(size uint64) {
if p == nil {
return
}
p.m.Lock()
defer p.m.Unlock()
p.s.FilesSkipped++
p.s.AllBytesSkipped += size
}
func (p *Progress) Finish() {
p.updater.Done()
}