mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
Refactor condition for MaxRepackBytes
Don't depend on the string (opts.MaxRepackSize) for the condition, instead check if there's a (positive) limit configured.
This commit is contained in:
parent
7f86eb4ec0
commit
1ca60bccfb
@ -390,7 +390,12 @@ func prune(opts PruneOptions, gopts GlobalOptions, repo restic.Repository, usedB
|
|||||||
|
|
||||||
for _, p := range repackCandidates {
|
for _, p := range repackCandidates {
|
||||||
reachedUnusedSizeAfter := (stats.size.unused-stats.size.remove-stats.size.repackrm < maxUnusedSizeAfter)
|
reachedUnusedSizeAfter := (stats.size.unused-stats.size.remove-stats.size.repackrm < maxUnusedSizeAfter)
|
||||||
reachedRepackSize := (len(opts.MaxRepackSize) > 0 && stats.size.repack+p.unusedSize+p.usedSize > opts.MaxRepackBytes)
|
|
||||||
|
reachedRepackSize := false
|
||||||
|
if opts.MaxRepackBytes > 0 {
|
||||||
|
reachedRepackSize = stats.size.repack+p.unusedSize+p.usedSize > opts.MaxRepackBytes
|
||||||
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case !reachedRepackSize && (p.duplicateBlobs > 0 || p.tpe == restic.InvalidBlob):
|
case !reachedRepackSize && (p.duplicateBlobs > 0 || p.tpe == restic.InvalidBlob):
|
||||||
// repacking duplicates/mixed is only limited by repackSize
|
// repacking duplicates/mixed is only limited by repackSize
|
||||||
|
Loading…
Reference in New Issue
Block a user