Optimize Repository.ListPack()
Use pack file size returned by Backend.List() to avoid extra per-pack Backend.Stat() requests Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
This commit is contained in:
parent
7e6bfdae79
commit
0084e42cb6
6 changed files with 27 additions and 22 deletions
|
@ -75,7 +75,7 @@ func selectBlobs(t *testing.T, repo restic.Repository, p float32) (list1, list2
|
|||
blobs := restic.NewBlobSet()
|
||||
|
||||
err := repo.List(context.TODO(), restic.DataFile, func(id restic.ID, size int64) error {
|
||||
entries, _, err := repo.ListPack(context.TODO(), id)
|
||||
entries, _, err := repo.ListPack(context.TODO(), id, size)
|
||||
if err != nil {
|
||||
t.Fatalf("error listing pack %v: %v", id, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue