Skip to content

Commit

Permalink
fix(tasks): use iterator for component alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jun 19, 2024
1 parent cbe8906 commit 4de5f5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weblate/trans/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def component_alerts(component_ids=None) -> None:
components = Component.objects.annotate(hourmod=F("id") % 24).filter(
hourmod=now.hour
)
for component in components.prefetch():
for component in components.prefetch().iterator(chunk_size=100):
with transaction.atomic():
component.update_alerts()

Expand Down

0 comments on commit 4de5f5d

Please sign in to comment.