From de8521ae567d937f8f747c265c78ad533b0859a6 Mon Sep 17 00:00:00 2001 From: greatroar <@> Date: Fri, 21 Feb 2020 09:51:43 +0100 Subject: [PATCH] Report number of successes from Restorer.VerifyFiles Previously, the number of attempts was reported. --- internal/restorer/restorer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/restorer/restorer.go b/internal/restorer/restorer.go index 60f9dc022..0d6e29b6d 100644 --- a/internal/restorer/restorer.go +++ b/internal/restorer/restorer.go @@ -317,8 +317,8 @@ const nVerifyWorkers = 8 // VerifyFiles checks whether all regular files in the snapshot res.sn // have been successfully written to dst. It stops when it encounters an -// error. It returns that error and the number of files it has checked, -// including the file(s) that caused errors. +// error. It returns that error and the number of files it has successfully +// verified. func (res *Restorer) VerifyFiles(ctx context.Context, dst string) (int, error) { type mustCheck struct { node *restic.Node @@ -358,11 +358,11 @@ func (res *Restorer) VerifyFiles(ctx context.Context, dst string) (int, error) { g.Go(func() (err error) { var buf []byte for job := range work { - atomic.AddUint64(&nchecked, 1) buf, err = res.verifyFile(job.path, job.node, buf) if err != nil { break } + atomic.AddUint64(&nchecked, 1) } return })