Skip to content

Commit

Permalink
Avoid OOM errors in revert tasks too
Browse files Browse the repository at this point in the history
  • Loading branch information
wetneb committed Jun 13, 2024
1 parent b8b3937 commit b43eb44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion revert/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def revert_batch(task_pk):
try:
task = RevertTask.objects.get(pk=task_pk)
edits = task.batch.edits.filter(reverted=False).order_by('-timestamp')
edits = task.batch.edits.filter(reverted=False).order_by('-timestamp').iterator()
for idx, edit in enumerate(edits):
if idx % 10 == 0:
task = RevertTask.objects.get(pk=task_pk)
Expand Down

0 comments on commit b43eb44

Please sign in to comment.