restorer: Sanitize verify errors

This commit is contained in:
Michael Eischer
2021-09-19 13:21:57 +02:00
parent bdcdfaf6b4
commit 2cdc0719af
2 changed files with 5 additions and 1 deletions

View File

@@ -351,6 +351,9 @@ func (res *Restorer) VerifyFiles(ctx context.Context, dst string) (int, error) {
for job := range work {
buf, err = res.verifyFile(job.path, job.node, buf)
if err != nil {
err = res.Error(job.path, err)
}
if err != nil || ctx.Err() != nil {
break
}
atomic.AddUint64(&nchecked, 1)