Skip to content

Commit f70316e

Browse files
committed
Works around a sync-time performance regression on PG12
closes pulp#4591
1 parent 3c7c7ce commit f70316e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGES/4591.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Resolved a sync-time performance regression.

pulpcore/app/models/repository.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,9 @@ def add_content(self, content):
850850
raise ResourceImmutableError(self)
851851

852852
repo_content = []
853-
to_add = set(content.exclude(pk__in=self.content).values_list("pk", flat=True))
853+
to_add = set(content.values_list("pk", flat=True)) - set(
854+
self.content.values_list("pk", flat=True)
855+
)
854856

855857
# Normalize representation if content has already been removed in this version and
856858
# is re-added: Undo removal by setting version_removed to None.

0 commit comments

Comments
 (0)