Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/in_memory.py
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | class InMemoryStorage: | ||||
def _skipped_content_add(self, contents: List[SkippedContent]) -> Dict: | def _skipped_content_add(self, contents: List[SkippedContent]) -> Dict: | ||||
self.journal_writer.skipped_content_add(contents) | self.journal_writer.skipped_content_add(contents) | ||||
summary = { | summary = { | ||||
'skipped_content:add': 0 | 'skipped_content:add': 0 | ||||
} | } | ||||
missing_contents = self.skipped_content_missing( | missing_contents = self.skipped_content_missing( | ||||
[c.to_dict() for c in contents]) | [c.hashes() for c in contents]) | ||||
missing = {self._content_key(c) for c in missing_contents} | missing = {self._content_key(c) for c in missing_contents} | ||||
contents = [c for c in contents | contents = [c for c in contents | ||||
if self._content_key(c) in missing] | if self._content_key(c) in missing] | ||||
for content in contents: | for content in contents: | ||||
key = self._content_key(content) | key = self._content_key(content) | ||||
for algo in DEFAULT_ALGORITHMS: | for algo in DEFAULT_ALGORITHMS: | ||||
if content.get_hash(algo): | if content.get_hash(algo): | ||||
self._skipped_content_indexes[algo][ | self._skipped_content_indexes[algo][ | ||||
▲ Show 20 Lines • Show All 731 Lines • Show Last 20 Lines |