Fix total_pages calculation bug and add tests

- Fixed total_pages calculation: API returns 5 events/page, not PAGE_SIZE
- This was causing partial=false positives when max_total was used
- Updated tests to use correct pagination values
This commit is contained in:
shoko
2026-03-26 16:54:41 +00:00
parent bab373ab8f
commit 1ae60f5661
2 changed files with 18 additions and 21 deletions

View File

@@ -235,7 +235,7 @@ def fetch_all_pages(
if total_raw == 0:
return {"events": [], "total_raw": 0, "partial": False}
total_pages = (total_raw + PAGE_SIZE - 1) // PAGE_SIZE
total_pages = (total_raw + 4) // 5
concurrency = min(MAX_PARALLEL_FETCHES, total_pages)
all_page_data: dict[int, list[Any]] = {}