mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 16:55:36 +00:00
Fix file cache save bug
This commit is contained in:
parent
243481f6da
commit
df85e72d3c
1 changed files with 4 additions and 3 deletions
|
@ -103,11 +103,12 @@ def commit(self):
|
|||
return
|
||||
if self.files is not None:
|
||||
with open(os.path.join(self.path, 'files'), 'wb') as fd:
|
||||
for item in self.files.items():
|
||||
for path_hash, item in self.files.items():
|
||||
# Discard cached files with the newest mtime to avoid
|
||||
# issues with filesystem snapshots and mtime precision
|
||||
if item[1][0] < 10 and item[1][3] < self._newest_mtime:
|
||||
msgpack.pack(item, fd)
|
||||
item = msgpack.unpackb(item)
|
||||
if item[0] < 10 and bigint_to_int(item[3]) < self._newest_mtime:
|
||||
msgpack.pack((path_hash, item), fd)
|
||||
self.config.set('cache', 'manifest', hexlify(self.manifest.id).decode('ascii'))
|
||||
self.config.set('cache', 'timestamp', self.manifest.timestamp)
|
||||
with open(os.path.join(self.path, 'config'), 'w') as fd:
|
||||
|
|
Loading…
Reference in a new issue