Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/in_memory.py
Show First 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | def _skipped_content_add(self, contents: List[SkippedContent]) -> Dict: | ||||
summary["skipped_content:add"] += 1 | summary["skipped_content:add"] += 1 | ||||
return summary | return summary | ||||
def skipped_content_add(self, content: List[SkippedContent]) -> Dict: | def skipped_content_add(self, content: List[SkippedContent]) -> Dict: | ||||
content = [attr.evolve(c, ctime=now()) for c in content] | content = [attr.evolve(c, ctime=now()) for c in content] | ||||
return self._skipped_content_add(content) | return self._skipped_content_add(content) | ||||
def skipped_content_missing(self, contents): | def skipped_content_missing( | ||||
self, contents: List[Dict[str, Any]] | |||||
) -> Iterable[Dict[str, Any]]: | |||||
for content in contents: | for content in contents: | ||||
matches = list(self._skipped_contents.values()) | matches = list(self._skipped_contents.values()) | ||||
for (algorithm, key) in self._content_key(content): | for (algorithm, key) in self._content_key(content): | ||||
if algorithm == "blake2s256": | if algorithm == "blake2s256": | ||||
continue | continue | ||||
# Filter out skipped contents with the same hash | # Filter out skipped contents with the same hash | ||||
matches = [ | matches = [ | ||||
match for match in matches if match.get_hash(algorithm) == key | match for match in matches if match.get_hash(algorithm) == key | ||||
▲ Show 20 Lines • Show All 872 Lines • Show Last 20 Lines |