Skip to content

Commit

Permalink
python lint
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbe committed Mar 11, 2021
1 parent 8432841 commit 4bfd17c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions deployer/src/deployer/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ def upload(
for task_iter in task_iters:
futures = {}
for task in task_iter:
if existing_bucket_objects:
# Independent of if we benefitted from the knowledge of the
# key already existing or not, remove it from the dict
# so we can figure out what remains later.
existing_bucket_objects.pop(task.key, None)

# Note: redirect upload tasks are never skipped.
if existing_bucket_objects and not task.is_redirect:
s3_obj = existing_bucket_objects.get(task.key)
Expand All @@ -445,18 +451,6 @@ def upload(
if on_task_complete:
on_task_complete(task)

# Before continuing, pop it from the existing dict because
# we no longer need it after the ETag comparison has been
# done.
existing_bucket_objects.pop(task.key, None)
continue

if existing_bucket_objects:
# Independent of if we benefitted from the knowledge of the
# key already existing or not, remove it from the dict
# so we can figure out what remains later.
existing_bucket_objects.pop(task.key, None)

future = executor.submit(task.upload, self)
futures[future] = task

Expand Down

0 comments on commit 4bfd17c

Please sign in to comment.