Skip to content

Commit

Permalink
back: reduce migration memory usage by using .iterator() instead of .…
Browse files Browse the repository at this point in the history
…all()
  • Loading branch information
GresilleSiffle committed Dec 19, 2024
1 parent 7d6bf43 commit ab65e38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/core/migrations/0016_migrate_reco_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def copy_setting(user, from_key, to_key):

def migrate_reco_settings_forward(apps, schema_editor):
User = apps.get_model("core", "User")
for user in User.objects.all():
for user in User.objects.iterator():
if "videos" not in user.settings:
continue

Expand Down

0 comments on commit ab65e38

Please sign in to comment.