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

Optimize loop in checksum task #1139

Merged
merged 3 commits into from
Jun 29, 2022
Merged

Conversation

mvandenburgh
Copy link
Member

@mvandenburgh mvandenburgh commented Jun 29, 2022

Fixes #1095

  • Uses QuerySet.iterator() to avoid loading every asset into memory at once
  • Uses QuerySet.values() to load only each asset's id into memory, instead of the entire Asset object
  • Delays the asset validation task instead of running it in the same thread as the checksum calculation

@mvandenburgh mvandenburgh added patch Increment the patch version when merged release Create a release when this pr is merged labels Jun 29, 2022
Copy link
Member

@jjnesbitt jjnesbitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mvandenburgh mvandenburgh merged commit d9aa126 into master Jun 29, 2022
@mvandenburgh mvandenburgh deleted the optimize-checksum-worker branch June 29, 2022 18:38
@dandibot
Copy link
Member

🚀 PR was released in v0.2.27 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

heroku[checksum-worker.1]: Error R14 (Memory quota exceeded)
3 participants