(self)
| 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 |
no test coverage detected