Changeset View
Changeset View
Standalone View
Standalone View
swh/journal/replay.py
Show All 39 Lines | elif object_type == 'origin_visit': | ||||
# old format; note that it will crash with the pg and | # old format; note that it will crash with the pg and | ||||
# in-mem storages if the origin is not already known, | # in-mem storages if the origin is not already known, | ||||
# 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: | ||||
# old format | visit['type'] = visit['origin'].get('type', None) | ||||
vlorentz: This looks like it's trying to hide a crash without solving the actual issue. | |||||
visit['type'] = visit['origin']['type'] | |||||
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 |
This looks like it's trying to hide a crash without solving the actual issue.