Use printer.NewCounter() instead of newTerminalProgressMax()

where possible (max is unknown).
This commit is contained in:
Dark Dragon 2025-02-02 17:30:45 +01:00
parent 536ebefff4
commit 79d435efb1
1 changed files with 3 additions and 4 deletions

View File

@ -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)