2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-14 09:14:07 +00:00

repair packs: deduplicate index rebuild

This commit is contained in:
Michael Eischer 2024-04-10 21:31:53 +02:00
parent 85e4021619
commit 4c9a10ca37

View File

@ -60,19 +60,7 @@ func RepairPacks(ctx context.Context, repo restic.Repository, ids restic.IDSet,
}
// remove salvaged packs from index
printer.P("rebuilding index")
bar = printer.NewCounter("packs processed")
err = repo.Index().Save(ctx, repo, ids, nil, restic.MasterIndexSaveOpts{
SaveProgress: bar,
DeleteProgress: func() *progress.Counter {
return printer.NewCounter("old indexes deleted")
},
DeleteReport: func(id restic.ID, _ error) {
printer.VV("removed index %v", id.String())
},
})
err = rebuildIndexFiles(ctx, repo, ids, nil, false, printer)
if err != nil {
return err
}