Add comment explaining total_pages ceiling division calculation

This commit is contained in:
shoko
2026-03-26 17:06:25 +00:00
parent 1ae60f5661
commit 09f3cb9066

View File

@@ -235,6 +235,8 @@ def fetch_all_pages(
if total_raw == 0:
return {"events": [], "total_raw": 0, "partial": False}
# API always returns exactly 5 events per page regardless of 'limit' param.
# This is integer ceiling division: ceil(total_raw / 5) = (total_raw + 5 - 1) // 5 = (total_raw + 4) // 5
total_pages = (total_raw + 4) // 5
concurrency = min(MAX_PARALLEL_FETCHES, total_pages)