Skip to content

Commit

Permalink
fixup! Add optimize mode for sync tasks
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
quba42 committed Aug 18, 2022
1 parent cfb896c commit 8a7322b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 9 additions & 1 deletion pulp_deb/app/serializers/repository_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ class AptRepositorySyncURLSerializer(RepositorySyncURLSerializer):
"""

optimize = serializers.BooleanField(
help_text=_("Whether or not to optimize sync."), required=False, default=True
help_text=_(
"Using optimize sync, will skip the processing of metadata if the checksum has not "
"changed since the last sync. This greately improves re-sync performance in such "
"situations. If you feel the sync is missing something that has changed about the "
"remote repository you are syncing, try using optimize=False for a full re-sync. "
"Consider opening an issue on why we should not optimize in your use case."
),
required=False,
default=True,
)


Expand Down
8 changes: 0 additions & 8 deletions pulp_deb/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,14 +771,6 @@ async def _handle_flat_repo(self, file_references, release_file, release):
# Await all tasks
await asyncio.gather(*pending_tasks)

def _nested_defaultdict(self, existing=None, **kwargs):
if existing is None:
existing = {}
if not isinstance(existing, dict):
return existing
existing = {key: self._nested_defaultdict(val) for key, val in existing.items()}
return defaultdict(self._nested_defaultdict, existing, **kwargs)

async def _handle_package_index(
self,
release_file,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pulpcore>=3.20,<3.25
pulpcore>=3.21,<3.25
python-debian>=0.1.44,<0.2.0

0 comments on commit 8a7322b

Please sign in to comment.