Skip to content

Commit

Permalink
Move all no-optimize fallbacks closer together
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
quba42 committed Sep 27, 2023
1 parent 2cee81c commit 85fbfc5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pulp_deb/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,6 @@ def synchronize(remote_pk, repository_pk, mirror, optimize):
repository = AptRepository.objects.get(pk=repository_pk)
previous_repo_version = repository.latest_version()

# TODO: The optimize feature currently does not work in combination with mirror=True! We fall
# back to full sync for now, until a proper fix is ready:
if mirror:
log.info(_("Falling back to optimize=False behaviour since mirror=True is set!"))
optimize = False

if not remote.url:
raise ValueError(_("A remote must have a url specified to synchronize."))

Expand Down Expand Up @@ -561,6 +555,12 @@ def __init__(self, remote, optimize, mirror, previous_repo_version, *args, **kwa
if mirror and not previous_sync_info["sync_options"]["mirror"]:
log.info(_("Setting optimize=False since this sync switches to mirror=True."))
self.optimize = False
if mirror:
log.info(_("Falling back to optimize=False behaviour since mirror=True is set!"))
log.info(_("See https://github.com/pulp/pulp_deb/issues/631 for more information."))
self.optimize = False
self.sync_info["sync_options"]["optimize"] = False


async def run(self):
"""
Expand Down

0 comments on commit 85fbfc5

Please sign in to comment.