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
5 changes: 4 additions & 1 deletion msticpy/data/drivers/cybereason_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def __execute_query(
page: int = 0,
page_size: int = 2000,
pagination_token: str = None,
max_retry: int = 3,
) -> Dict[str, Any]:
"""
Run query with pagination enabled.
Expand Down Expand Up @@ -436,7 +437,8 @@ def __execute_query(
headers = {}
params = {"page": page, "itemsPerPage": page_size}
status = None
while status != "SUCCESS":
cur_try = 0
while status != "SUCCESS" and cur_try < max_retry:
response = self.client.post(
self.search_endpoint,
json={**body, **pagination},
Expand All @@ -446,6 +448,7 @@ def __execute_query(
response.raise_for_status()
json_result = response.json()
status = json_result["status"]
cur_try += 1
return json_result

async def __run_threaded_queries(
Expand Down