Skip to content

Commit 129ef95

Browse files
author
Simon Prickett
committed
Performance improvement for first - avoids unnecessary pagination.
1 parent c0fa1be commit 129ef95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aredis_om/model/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ async def execute(self, exhaust_results=True):
749749

750750
async def first(self):
751751
query = self.copy(offset=0, limit=1, sort_fields=self.sort_fields)
752-
results = await query.execute()
752+
results = await query.execute(exhaust_results=False)
753753
if not results:
754754
raise NotFoundError()
755755
return results[0]

0 commit comments

Comments
 (0)