From 06af16239481847840430d6a01c800d4716d290d Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Wed, 6 Sep 2023 19:53:16 -0700 Subject: [PATCH] fix(cli): added output to indicate completion of snapshot verification (#3275) --- cli/command_snapshot_verify.go | 1 + snapshot/snapshotfs/snapshot_verifier.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/cli/command_snapshot_verify.go b/cli/command_snapshot_verify.go index 500bcb750..5c45f2cf3 100644 --- a/cli/command_snapshot_verify.go +++ b/cli/command_snapshot_verify.go @@ -69,6 +69,7 @@ func (c *commandSnapshotVerify) run(ctx context.Context, rep repo.Repository) er } v := snapshotfs.NewVerifier(ctx, rep, opts) + defer v.ShowFinalStats(ctx) //nolint:wrapcheck return v.InParallel(ctx, func(tw *snapshotfs.TreeWalker) error { diff --git a/snapshot/snapshotfs/snapshot_verifier.go b/snapshot/snapshotfs/snapshot_verifier.go index e72d26e0e..4534fcc29 100644 --- a/snapshot/snapshotfs/snapshot_verifier.go +++ b/snapshot/snapshotfs/snapshot_verifier.go @@ -49,6 +49,13 @@ func (v *Verifier) ShowStats(ctx context.Context) { verifierLog(ctx).Infof("Processed %v objects.", processed) } +// ShowFinalStats logs final verification statistics. +func (v *Verifier) ShowFinalStats(ctx context.Context) { + processed := v.processed.Load() + + verifierLog(ctx).Infof("Finished processing %v objects.", processed) +} + // VerifyFile verifies a single file object (using content check, blob map check or full read). func (v *Verifier) VerifyFile(ctx context.Context, oid object.ID, entryPath string) error { verifierLog(ctx).Debugf("verifying object %v", oid)