mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 14:56:29 +00:00
prune: Simplify logic selecting packs to repack
This commit is contained in:
parent
daeb4cdf8f
commit
e08e65dc30
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user