We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0629729 + 13d0529 commit c409d6aCopy full SHA for c409d6a
1 file changed
simvue/api/request.py
@@ -303,12 +303,17 @@ def get_paginated(
303
server response
304
"""
305
_offset: int = offset or 0
306
+
307
+ # Restrict the number of entries retrieved to be paginated,
308
+ # if the count requested is below page limit use this value
309
+ # else if undefined or greater than the page limit use the limit
310
+ _request_count: int = min(count or MAX_ENTRIES_PER_PAGE, MAX_ENTRIES_PER_PAGE)
311
312
while (
313
_response := get(
314
url=url,
315
headers=headers,
- params=(params or {})
- | {"count": count or MAX_ENTRIES_PER_PAGE, "start": _offset},
316
+ params=(params or {}) | {"count": _request_count, "start": _offset},
317
timeout=timeout,
318
json=json,
319
)
0 commit comments