-
Notifications
You must be signed in to change notification settings - Fork 53
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
Reduce amount of time the repository lock is held #314
Conversation
Attached issue: https://pulp.plan.io/issues/6677 |
@@ -195,6 +196,17 @@ def create_collection_from_importer(importer_result): | |||
return collection_version | |||
|
|||
|
|||
def add_collection_to_repository(repository_pk, collection_version_pk): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is presumably close enough to the same as https://github.com/ansible/galaxy_ng/blob/master/galaxy_ng/app/tasks/promotion.py#L4
that galaxy_ng should be able to use pulpcore.app.tasks.collections.add_collection_to_repository() once it is merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pinging @awcrosby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that is something we could look at replacing with this
task = instance.task | ||
|
||
completed = ["completed", "failed", "canceled"] | ||
|
||
for child in task.child_tasks.all(): | ||
if child.state not in completed: | ||
task.state = child.state | ||
task.finished_at = child.finished_at | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmbouter this is what I mentioned felt like a hack
too old PR |
https://pulp.plan.io/issues/6677
closes #6677