2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 00:33:57 +00:00

prune: Simplify logic selecting packs to repack

This commit is contained in:
Alexander Weiss 2021-01-29 22:25:41 +01:00
parent daeb4cdf8f
commit e08e65dc30

View File

@ -434,11 +434,14 @@ func prune(opts PruneOptions, gopts GlobalOptions, repo restic.Repository, usedB
} }
switch { switch {
case !reachedRepackSize && (p.duplicateBlobs > 0 || p.tpe != restic.DataBlob): case reachedRepackSize:
keep(p.packInfo)
case p.duplicateBlobs > 0, p.tpe != restic.DataBlob:
// repacking duplicates/non-data is only limited by repackSize // repacking duplicates/non-data is only limited by repackSize
repack(p.ID, p.packInfo) repack(p.ID, p.packInfo)
case reachedUnusedSizeAfter, reachedRepackSize: case reachedUnusedSizeAfter:
// for all other packs stop repacking if tolerated unused size is reached. // for all other packs stop repacking if tolerated unused size is reached.
keep(p.packInfo) keep(p.packInfo)