2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-27 20:45:19 +00:00

repository: remove prune plan parts once they are no longer necessary

This commit is contained in:
Michael Eischer 2024-05-20 15:43:22 +02:00
parent 462b82a060
commit 3c7b7efdc9

View File

@ -545,6 +545,8 @@ func (plan *PrunePlan) Execute(ctx context.Context, printer progress.Printer) er
if len(plan.removePacksFirst) != 0 {
printer.P("deleting unreferenced packs\n")
_ = deleteFiles(ctx, true, repo, plan.removePacksFirst, restic.PackFile, printer)
// forget unused data
plan.removePacksFirst = nil
}
if ctx.Err() != nil {
return ctx.Err()
@ -562,6 +564,8 @@ func (plan *PrunePlan) Execute(ctx context.Context, printer progress.Printer) er
// Also remove repacked packs
plan.removePacks.Merge(plan.repackPacks)
// forget unused data
plan.repackPacks = nil
if plan.keepBlobs.Len() != 0 {
printer.E("%v was not repacked\n\n"+