2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-28 06:30:53 +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 {
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
repack(p.ID, p.packInfo)
case reachedUnusedSizeAfter, reachedRepackSize:
case reachedUnusedSizeAfter:
// for all other packs stop repacking if tolerated unused size is reached.
keep(p.packInfo)