Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/in_memory.py
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | def _content_add(self, contents, with_data): | ||||
self.objstorage.add(content_data, content['sha1']) | self.objstorage.add(content_data, content['sha1']) | ||||
summary = { | summary = { | ||||
'content:add': count_content_added, | 'content:add': count_content_added, | ||||
'skipped_content:add': count_contents - count_content_added, | 'skipped_content:add': count_contents - count_content_added, | ||||
} | } | ||||
if with_data: | if with_data: | ||||
summary['content:bytes:add'] = count_content_bytes_added | summary['content:add:bytes'] = count_content_bytes_added | ||||
return summary | return summary | ||||
def content_add(self, contents): | def content_add(self, contents): | ||||
"""Add content blobs to the storage | """Add content blobs to the storage | ||||
Args: | Args: | ||||
content (iterable): iterable of dictionaries representing | content (iterable): iterable of dictionaries representing | ||||
▲ Show 20 Lines • Show All 1,427 Lines • Show Last 20 Lines |