Skip to content

Commit b7ce840

Browse files
committed
Include upload pages in collection pageCount
1 parent 3cc35fb commit b7ce840

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

backend/btrixcloud/colls.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,17 @@ async def update_collection_counts_and_tags(self, collection_id: UUID):
467467
files = crawl.files or []
468468
for file in files:
469469
total_size += file.size
470-
if crawl.stats:
471-
page_count += crawl.stats.done
470+
471+
try:
472+
org = await self.orgs.get_org_by_id(crawl.oid)
473+
_, crawl_pages = await self.page_ops.list_pages(
474+
crawl.id, org, page_size=1_000_000
475+
)
476+
page_count += crawl_pages
477+
# pylint: disable=broad-exception-caught
478+
except Exception:
479+
pass
480+
472481
if crawl.tags:
473482
tags.extend(crawl.tags)
474483

0 commit comments

Comments
 (0)