Skip to content

Commit b132106

Browse files
committed
empty filenames migration: use existing bulk re_add method for faster migration
1 parent 4054c2a commit b132106

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

backend/btrixcloud/migrations/migration_0042_page_filenames.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ async def migrate_up(self):
5555
crawl_id = crawl.get("_id")
5656
print(f"Migrating archived item {current_index}/{crawl_count}", flush=True)
5757
try:
58-
await self.page_ops.add_crawl_wacz_filename_to_pages(crawl_id)
58+
await self.page_ops.re_add_crawl_pages(crawl_id)
59+
# await self.page_ops.add_crawl_wacz_filename_to_pages(crawl_id)
5960
# pylint: disable=broad-exception-caught
6061
except Exception as err:
6162
print(

backend/btrixcloud/pages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ async def list_collection_pages(
784784

785785
return [PageOut.from_dict(data) for data in items], total
786786

787-
async def re_add_crawl_pages(self, crawl_id: str, oid: UUID):
787+
async def re_add_crawl_pages(self, crawl_id: str, oid: Optional[UUID] = None):
788788
"""Delete existing pages for crawl and re-add from WACZs."""
789789

790790
try:

0 commit comments

Comments
 (0)