checker: Use Load() instead of GetReader()

This commit is contained in:
Alexander Neumann committed 2016-01-24 00:42:04 +01:00
1 parent 782a1bf7b0
commit 280d580ae2
2 files changed
+14 -38

No files matched your search

+2 -12
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"sync"
"github.com/restic/restic"
@@ -647,17 +646,8 @@ func (c *Checker) CountPacks() uint64 {
// checkPack reads a pack and checks the integrity of all blobs.
func checkPack(r *repository.Repository, id backend.ID) error {
debug.Log("Checker.checkPack", "checking pack %v", id.Str())
rd, err := r.Backend().GetReader(backend.Data, id.String(), 0, 0)
if err != nil {
return err
}
buf, err := ioutil.ReadAll(rd)
if err != nil {
return err
}
err = rd.Close()
h := backend.Handle{Type: backend.Data, Name: id.String()}
buf, err := backend.LoadAll(r.Backend(), h, nil)
if err != nil {
return err
}