Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/postgresql/storage.py
Show First 20 Lines • Show All 518 Lines • ▼ Show 20 Lines | ) -> Dict[str, int]: | ||||
self.journal_writer.directory_add( | self.journal_writer.directory_add( | ||||
dir_ for dir_ in directories if dir_.id in dirs_missing | dir_ for dir_ in directories if dir_.id in dirs_missing | ||||
) | ) | ||||
# Copy directory ids | # Copy directory ids | ||||
dirs_missing_dict = ({"id": dir} for dir in dirs_missing) | dirs_missing_dict = ({"id": dir} for dir in dirs_missing) | ||||
db.mktemp("directory", cur) | db.mktemp("directory", cur) | ||||
db.copy_to(dirs_missing_dict, "tmp_directory", ["id"], cur) | db.copy_to(dirs_missing_dict, "tmp_directory", ["id", "raw_manifest"], cur) | ||||
# Copy entries | # Copy entries | ||||
for entry_type, entry_list in dir_entries.items(): | for entry_type, entry_list in dir_entries.items(): | ||||
entries = itertools.chain.from_iterable( | entries = itertools.chain.from_iterable( | ||||
entries_for_dir | entries_for_dir | ||||
for dir_id, entries_for_dir in entry_list.items() | for dir_id, entries_for_dir in entry_list.items() | ||||
if dir_id in dirs_missing | if dir_id in dirs_missing | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 1,061 Lines • Show Last 20 Lines |