mirror of
https://github.com/restic/restic.git
synced 2026-06-21 08:04:18 +00:00
prune/repair pack: document ignored errors
This commit is contained in:
@@ -611,6 +611,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
|
||||
@@ -668,6 +669,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 {
|
||||
|
||||
@@ -79,6 +79,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