mirror of
https://github.com/restic/restic.git
synced 2026-06-26 18:44:17 +00:00
prune/repair pack: document ignored errors
This commit is contained in:
@@ -586,6 +586,7 @@ func (plan *PrunePlan) Execute(ctx context.Context, printer progress.Printer) er
|
||||
// unreferenced packs can be safely deleted first
|
||||
if len(plan.removePacksFirst) != 0 {
|
||||
printer.P("deleting unreferenced packs\n")
|
||||
// ignoring errors is fine here as keeping too many packs cannot damage the repository
|
||||
_ = deleteFiles(ctx, true, &internalRepository{repo}, plan.removePacksFirst, restic.PackFile, printer)
|
||||
// forget unused data
|
||||
plan.removePacksFirst = nil
|
||||
@@ -643,6 +644,7 @@ func (plan *PrunePlan) Execute(ctx context.Context, printer progress.Printer) er
|
||||
|
||||
if len(plan.removePacks) != 0 {
|
||||
printer.P("removing %d old packs", len(plan.removePacks))
|
||||
// ignoring errors is fine here as keeping too many packs cannot damage the repository
|
||||
_ = deleteFiles(ctx, true, &internalRepository{repo}, plan.removePacks, restic.PackFile, printer)
|
||||
}
|
||||
if ctx.Err() != nil {
|
||||
|
||||
@@ -78,6 +78,7 @@ func resolveBlobsForPacks(ctx context.Context, repo *Repository, ids restic.IDSe
|
||||
if ids.Has(id) {
|
||||
blobs, _, err := repo.ListPack(ctx, id, size)
|
||||
if err != nil {
|
||||
// ignore errors for broken pack files to be able to salvage as much as possible
|
||||
return nil
|
||||
}
|
||||
packToBlobs[id] = blobs
|
||||
|
||||
Reference in New Issue
Block a user