From 79d435efb1571f887989118dd3b3df41683a4fcb Mon Sep 17 00:00:00 2001 From: Dark Dragon Date: Sun, 2 Feb 2025 17:30:45 +0100 Subject: [PATCH] Use printer.NewCounter() instead of newTerminalProgressMax() where possible (max is unknown). --- cmd/restic/cmd_check.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index 8788b0caf..3ae79149e 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -316,7 +316,7 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args wg.Add(1) go func() { defer wg.Done() - bar := newTerminalProgressMax(!gopts.Quiet, 0, "snapshots", term) + bar := printer.NewCounter("snapshots") defer bar.Done() 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) { - packCount := uint64(len(packs)) - - p := newTerminalProgressMax(!gopts.Quiet, packCount, "packs", term) + p := printer.NewCounter("packs") + p.SetMax(uint64(len(packs))) errChan := make(chan error) go chkr.ReadPacks(ctx, packs, p, errChan)