mirror of https://github.com/restic/restic.git
Use printer.NewCounter() instead of newTerminalProgressMax()
where possible (max is unknown).
This commit is contained in:
parent
536ebefff4
commit
79d435efb1
|
@ -316,7 +316,7 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
bar := newTerminalProgressMax(!gopts.Quiet, 0, "snapshots", term)
|
bar := printer.NewCounter("snapshots")
|
||||||
defer bar.Done()
|
defer bar.Done()
|
||||||
chkr.Structure(ctx, bar, errChan)
|
chkr.Structure(ctx, bar, errChan)
|
||||||
}()
|
}()
|
||||||
|
@ -353,9 +353,8 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
|
||||||
}
|
}
|
||||||
|
|
||||||
doReadData := func(packs map[restic.ID]int64) {
|
doReadData := func(packs map[restic.ID]int64) {
|
||||||
packCount := uint64(len(packs))
|
p := printer.NewCounter("packs")
|
||||||
|
p.SetMax(uint64(len(packs)))
|
||||||
p := newTerminalProgressMax(!gopts.Quiet, packCount, "packs", term)
|
|
||||||
errChan := make(chan error)
|
errChan := make(chan error)
|
||||||
|
|
||||||
go chkr.ReadPacks(ctx, packs, p, errChan)
|
go chkr.ReadPacks(ctx, packs, p, errChan)
|
||||||
|
|
Loading…
Reference in New Issue