mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-28 04:03:21 -04:00
pre12-meta cache: do not use the cache if want_unique is True, fixes #6612
we can't cache usize, it needs to get dynamically calculated.
This commit is contained in:
parent
70e30dea4d
commit
2a15ccf5ac
1 changed files with 6 additions and 0 deletions
|
|
@ -650,6 +650,12 @@ Utilization of max. archive size: {csize_max:.0%}
|
|||
# caching wrapper around _calc_stats which is rather slow for archives made with borg < 1.2
|
||||
have_borg12_meta = self.metadata.get('nfiles') is not None
|
||||
try:
|
||||
if want_unique:
|
||||
# usize is neither contained in the borg 1.2 archive metadata nor in the
|
||||
# pre12_meta cache entry representing the same information for 1.1 archives.
|
||||
# usize is not a static property of an archive, but must get dynamically calculated,
|
||||
# thus we must trigger a call to self._calc_stats() to get it.
|
||||
raise KeyError
|
||||
stats = Statistics.from_raw_dict(**cache.pre12_meta[self.fpr])
|
||||
except KeyError: # not in pre12_meta cache
|
||||
stats = self._calc_stats(cache, want_unique=want_unique)
|
||||
|
|
|
|||
Loading…
Reference in a new issue