Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/postgresql/storage.py
Show First 20 Lines • Show All 669 Lines • ▼ Show 20 Lines | def extid_add(self, ids: List[ExtID], db=None, cur=None) -> Dict[str, int]: | ||||
"extid_type": extid.extid_type, | "extid_type": extid.extid_type, | ||||
"target": extid.target.object_id, | "target": extid.target.object_id, | ||||
"target_type": extid.target.object_type.name.lower(), # arghh | "target_type": extid.target.object_type.name.lower(), # arghh | ||||
} | } | ||||
for extid in ids | for extid in ids | ||||
] | ] | ||||
db.mktemp("extid", cur) | db.mktemp("extid", cur) | ||||
self.journal_writer.extid_add(ids) | |||||
db.copy_to(extid, "tmp_extid", db.extid_cols, cur) | db.copy_to(extid, "tmp_extid", db.extid_cols, cur) | ||||
# move metadata in place | # move metadata in place | ||||
db.extid_add_from_temp(cur) | db.extid_add_from_temp(cur) | ||||
return {"extid:add": len(extid)} | return {"extid:add": len(extid)} | ||||
@timed | @timed | ||||
▲ Show 20 Lines • Show All 787 Lines • Show Last 20 Lines |