fix: harden wiki delivery and leaderboard performance
This commit is contained in:
1 parent
0c5e2e8cb0
commit
9f29ecae9e
28 files changed
+616
-68
No files matched your search
+7
@@ -90,6 +90,13 @@ class WikiSyncService:
|
||||
batch = await self.client.list_wiki_pages(remote_id, page=page_number, page_size=self.config.sync_page_size)
|
||||
pages = [page for page in batch.get("pages", []) if isinstance(page, dict)]
|
||||
remote_count += len(pages)
|
||||
reported_total = int(batch.get("total") or batch.get("total_count") or remote_count)
|
||||
await self.store.update_sync_progress(
|
||||
mapping_id,
|
||||
owner=self.owner,
|
||||
sync_id=sync_id,
|
||||
remote_page_count=max(remote_count, reported_total),
|
||||
)
|
||||
for summary in pages:
|
||||
try:
|
||||
_ensure_lease()
|
||||
|
||||
Reference in new issue
Block a user