Report number of successes from Restorer.VerifyFiles
Previously, the number of attempts was reported.
This commit is contained in:
parent
bb066cf7d3
commit
de8521ae56
1 changed files with 3 additions and 3 deletions
|
@ -317,8 +317,8 @@ const nVerifyWorkers = 8
|
||||||
|
|
||||||
// VerifyFiles checks whether all regular files in the snapshot res.sn
|
// VerifyFiles checks whether all regular files in the snapshot res.sn
|
||||||
// have been successfully written to dst. It stops when it encounters an
|
// 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,
|
// error. It returns that error and the number of files it has successfully
|
||||||
// including the file(s) that caused errors.
|
// verified.
|
||||||
func (res *Restorer) VerifyFiles(ctx context.Context, dst string) (int, error) {
|
func (res *Restorer) VerifyFiles(ctx context.Context, dst string) (int, error) {
|
||||||
type mustCheck struct {
|
type mustCheck struct {
|
||||||
node *restic.Node
|
node *restic.Node
|
||||||
|
@ -358,11 +358,11 @@ func (res *Restorer) VerifyFiles(ctx context.Context, dst string) (int, error) {
|
||||||
g.Go(func() (err error) {
|
g.Go(func() (err error) {
|
||||||
var buf []byte
|
var buf []byte
|
||||||
for job := range work {
|
for job := range work {
|
||||||
atomic.AddUint64(&nchecked, 1)
|
|
||||||
buf, err = res.verifyFile(job.path, job.node, buf)
|
buf, err = res.verifyFile(job.path, job.node, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
atomic.AddUint64(&nchecked, 1)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue