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

Refactor finalize new_version method for better performance #1364

Open
rochacbruno opened this issue Feb 20, 2023 · 0 comments
Open

Refactor finalize new_version method for better performance #1364

rochacbruno opened this issue Feb 20, 2023 · 0 comments

Comments

@rochacbruno
Copy link
Member

Comment from @mdellweg

this can significantly slow down sync, as this collection version basically jumps the whole pipeline without waiting to be processed in batches. We should refactor this soon.

Originally posted by @mdellweg in #1326 (comment)

Also

All we care for in the c_version is the pk. Right? I don't think we need to cast for that. And at that point we don't even need the loop anymore, right?
Would the following work?

    signatures = new_version.get_content(
        content_qs=CollectionVersionSignature.objects.filter(signed_collection__in=removed_collection_versions)
    )
    new_version.remove_content(signatures)

Member

@mdellweg mdellweg 9 hours ago
Also do we maybe need to call remove_duplicates first? It may remove more CVs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant