Skip to content

Commit

Permalink
Change database result fetching to be batched
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Jun 27, 2021
1 parent d12fb31 commit dcc6fbc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions irrd/storage/database_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ def execute_query():
else:
raise exc

for row in result.fetchall():
yield dict(row)
result_partition = result.fetchmany()
while result_partition:
for row in result_partition:
yield dict(row)
result_partition = result.fetchmany()
result.close()

def execute_statement(self, statement):
Expand Down

0 comments on commit dcc6fbc

Please sign in to comment.