restorer: separately track skipped files

This commit is contained in:
Michael Eischer
2024-05-31 14:12:06 +02:00
parent 64b7b6b975
commit e47e08a688
8 changed files with 94 additions and 30 deletions

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()
}