Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/storage.py
Show First 20 Lines • Show All 481 Lines • ▼ Show 20 Lines | def skipped_content_missing(self, contents, db=None, cur=None): | ||||
Args: | Args: | ||||
content: iterable of dictionaries containing the data for each | content: iterable of dictionaries containing the data for each | ||||
checksum algorithm. | checksum algorithm. | ||||
Returns: | Returns: | ||||
iterable: missing signatures | iterable: missing signatures | ||||
""" | """ | ||||
keys = db.content_hash_keys | for content in db.skipped_content_missing(contents, cur): | ||||
yield dict(zip(db.content_hash_keys, content)) | |||||
db.mktemp('skipped_content', cur) | |||||
db.copy_to(contents, 'tmp_skipped_content', | |||||
keys + ['length', 'reason'], cur) | |||||
yield from db.skipped_content_missing_from_temp(cur) | |||||
@db_transaction() | @db_transaction() | ||||
def content_find(self, content, db=None, cur=None): | def content_find(self, content, db=None, cur=None): | ||||
"""Find a content hash in db. | """Find a content hash in db. | ||||
Args: | Args: | ||||
content: a dictionary representing one content hash, mapping | content: a dictionary representing one content hash, mapping | ||||
checksum algorithm names (see swh.model.hashutil.ALGORITHMS) to | checksum algorithm names (see swh.model.hashutil.ALGORITHMS) to | ||||
▲ Show 20 Lines • Show All 1,299 Lines • Show Last 20 Lines |