Skip to content

Commit

Permalink
Await response before parsing json data (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Sep 28, 2023
1 parent c1c2d21 commit 3beee92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fmu/sumo/explorer/objects/_document_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ async def _next_batch_async(self) -> List[Dict]:
if self._pit is not None:
query["pit"] = self._pit.get_pit_object()

res = await self._sumo.post_async("/search", json=query).json()
hits = res["hits"]
res = await self._sumo.post_async("/search", json=query)
hits = res.json()["hits"]

if self._len is None:
self._len = hits["total"]["value"]
Expand Down

0 comments on commit 3beee92

Please sign in to comment.