Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1593 populate existing asset storage image #1619

Merged
merged 10 commits into from
Feb 24, 2022
4 changes: 2 additions & 2 deletions concordia/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def populate_storage_image_values(asset_qs=None):
asset_qs = (
Asset.objects.filter(storage_image__isnull=True)
.order_by("id")
.select_related("item__project__campaign")[:20000]
.select_related("item__project__campaign")[:50000]
)

logger.debug("Start storage image chunking")
Expand All @@ -374,7 +374,7 @@ def populate_storage_image_values(asset_qs=None):
# We'll process assets in chunks using an iterator to avoid saving objects
# which will never be used again in memory. We will build the S3 relative key for
# each existing asset and pass them to bulk_update() to be saved in a single query.
for asset_chunk in chunked(asset_qs.iterator(), 2000):
for asset_chunk in chunked(asset_qs.iterator(), 3000):

for asset in asset_chunk:
asset.storage_image = "/".join(
Expand Down