MCPcopy
hub / github.com/borgbackup/borg / close

Method close

src/borg/cache.py:1012–1031  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1010 self.cache_config.load()
1011
1012 def close(self):
1013 self.security_manager.save(self.manifest, self.key)
1014 pi = ProgressIndicatorMessage(msgid="cache.close")
1015 if self._files is not None:
1016 pi.output("Saving files cache")
1017 integrity_data = self._write_files_cache(self._files)
1018 self.cache_config.integrity[self.files_cache_name()] = integrity_data
1019 if self._chunks is not None:
1020 for key, value in sorted(self._chunks.stats.items()):
1021 logger.debug(f"Chunks index stats: {key}: {value}")
1022 pi.output("Saving chunks cache")
1023 # note: cache/chunks.* in repo has a different integrity mechanism
1024 now = datetime.now(timezone.utc)
1025 self._maybe_write_chunks_cache(now, force=True, clear=True)
1026 self._chunks = None # nothing there (cleared!)
1027 pi.output("Saving cache config")
1028 self.cache_config.save(self.manifest)
1029 self.cache_config.close()
1030 pi.finish()
1031 self.cache_config = None
1032
1033 def check_cache_compatibility(self):
1034 my_features = Manifest.SUPPORTED_REPO_FEATURES

Callers 2

__init__Method · 0.95
__exit__Method · 0.95

Calls 10

outputMethod · 0.95
_write_files_cacheMethod · 0.80
files_cache_nameMethod · 0.80
debugMethod · 0.80
saveMethod · 0.45
itemsMethod · 0.45
closeMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected