Changeset View
Changeset View
Standalone View
Standalone View
swh/journal/replay.py
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | elif object_type == 'origin_visit': | ||||
# but there is no other choice because we can't add an | # but there is no other choice because we can't add an | ||||
# origin without knowing its type. Non-pg storages | # origin without knowing its type. Non-pg storages | ||||
# don't use a numeric FK internally, | # don't use a numeric FK internally, | ||||
visit['origin'] = {'url': visit['origin']} | visit['origin'] = {'url': visit['origin']} | ||||
else: | else: | ||||
storage.origin_add_one(visit['origin']) | storage.origin_add_one(visit['origin']) | ||||
if 'type' not in visit: | if 'type' not in visit: | ||||
visit['type'] = visit['origin'].get('type', None) | visit['type'] = visit['origin'].get('type', None) | ||||
if 'metadata' not in visit: | |||||
visit['metadata'] = None | |||||
storage.origin_visit_upsert(objects) | storage.origin_visit_upsert(objects) | ||||
else: | else: | ||||
logger.warning('Received a series of %s, this should not happen', | logger.warning('Received a series of %s, this should not happen', | ||||
object_type) | object_type) | ||||
def copy_object(obj_id, src, dst): | def copy_object(obj_id, src, dst): | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |