Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions simvue/api/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,17 @@ def get_paginated(
server response
"""
_offset: int = offset or 0

# Restrict the number of entries retrieved to be paginated,
# if the count requested is below page limit use this value
# else if undefined or greater than the page limit use the limit
_request_count: int = min(count or MAX_ENTRIES_PER_PAGE, MAX_ENTRIES_PER_PAGE)

while (
_response := get(
url=url,
headers=headers,
params=(params or {})
| {"count": count or MAX_ENTRIES_PER_PAGE, "start": _offset},
params=(params or {}) | {"count": _request_count, "start": _offset},
timeout=timeout,
json=json,
)
Expand Down
Loading