Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/storage.py
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | def _content_add_metadata(self, db, cur, content): | ||||
) from None | ) from None | ||||
else: | else: | ||||
raise | raise | ||||
@timed | @timed | ||||
@process_metrics | @process_metrics | ||||
def content_add(self, content: Iterable[Content]) -> Dict: | def content_add(self, content: Iterable[Content]) -> Dict: | ||||
ctime = now() | ctime = now() | ||||
contents = [attr.evolve(c, ctime=ctime) for c in content] | contents = [attr.evolve(c, ctime=ctime) for c in content] | ||||
objstorage_summary = self.objstorage.content_add(contents) | objstorage_summary = self.objstorage.content_add(contents) | ||||
with self.db() as db: | with self.db() as db: | ||||
with db.transaction() as cur: | with db.transaction() as cur: | ||||
missing = list( | missing = list( | ||||
self.content_missing( | self.content_missing( | ||||
▲ Show 20 Lines • Show All 1,016 Lines • ▼ Show 20 Lines | |||||
def diff_revision(self, revision, track_renaming=False): | def diff_revision(self, revision, track_renaming=False): | ||||
return diff.diff_revision(self, revision, track_renaming) | return diff.diff_revision(self, revision, track_renaming) | ||||
def clear_buffers(self, object_types: Optional[Iterable[str]] = None) -> None: | def clear_buffers(self, object_types: Optional[Iterable[str]] = None) -> None: | ||||
"""Do nothing | """Do nothing | ||||
""" | """ | ||||
return None | return None | ||||
def flush(self, object_types: Optional[Iterable[str]] = None) -> Dict: | |||||
return {} |