mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 17:27:31 +00:00
Merge pull request #2946 from ThomasWaldmann/workaround-files-cache-corruption
ignore corrupt files cache, fixes #2939
This commit is contained in:
commit
584886a22a
1 changed files with 10 additions and 4 deletions
|
@ -503,10 +503,16 @@ def _read_files(self):
|
|||
if not data:
|
||||
break
|
||||
u.feed(data)
|
||||
for path_hash, item in u:
|
||||
entry = FileCacheEntry(*item)
|
||||
# in the end, this takes about 240 Bytes per file
|
||||
self.files[path_hash] = msgpack.packb(entry._replace(age=entry.age + 1))
|
||||
try:
|
||||
for path_hash, item in u:
|
||||
entry = FileCacheEntry(*item)
|
||||
# in the end, this takes about 240 Bytes per file
|
||||
self.files[path_hash] = msgpack.packb(entry._replace(age=entry.age + 1))
|
||||
except (TypeError, ValueError) as exc:
|
||||
logger.warning('The files cache seems corrupt, ignoring it. '
|
||||
'Expect lower performance. [%s]' % str(exc))
|
||||
self.files = {}
|
||||
return
|
||||
|
||||
def begin_txn(self):
|
||||
# Initialize transaction snapshot
|
||||
|
|
Loading…
Reference in a new issue