2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 19:08:55 +00:00

Merge pull request #3996 from MichaelEischer/fix-ui-progress

backup: fix stuck status bar
This commit is contained in:
rawtaz 2022-11-02 21:48:16 +01:00 committed by GitHub
commit 92df039e5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,7 @@ func (p *Progress) Run(ctx context.Context) {
} }
p.mu.Lock() p.mu.Lock()
if p.scanStarted { if !p.scanStarted {
p.mu.Unlock() p.mu.Unlock()
continue continue
} }
@ -231,11 +231,10 @@ func (p *Progress) ReportTotal(item string, s archiver.ScanStats) {
defer p.mu.Unlock() defer p.mu.Unlock()
p.total = Counter{Files: uint64(s.Files), Dirs: uint64(s.Dirs), Bytes: s.Bytes} p.total = Counter{Files: uint64(s.Files), Dirs: uint64(s.Dirs), Bytes: s.Bytes}
p.scanStarted = true
if item == "" { if item == "" {
p.printer.ReportTotal(item, p.start, s) p.printer.ReportTotal(item, p.start, s)
p.scanStarted = true
return
} }
} }