Skip to content

Commit

Permalink
🐛(backends) fix bug iterating over async mongo collections
Browse files Browse the repository at this point in the history
The update to a recent version of `motor` highlighted a bug on our side when
listing collections. Now asynchronously iterate over collections list.
  • Loading branch information
wilbrdt committed Sep 6, 2023
1 parent 713f133 commit 2058395
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ backend-lrs =
httpx==0.24.1
more-itertools==10.1.0
backend-mongo =
motor[srv]>=3.1.1
motor[srv]>=3.3.0
pymongo[srv]>=4.0.0
python-dateutil>=2.8.2
backend-s3 =
Expand Down
2 changes: 1 addition & 1 deletion src/ralph/backends/data/async_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def list(

try:
collections = await database.list_collections()
for collection_info in collections:
async for collection_info in collections:
if details:
yield collection_info
else:
Expand Down

0 comments on commit 2058395

Please sign in to comment.