From 4bfd17c56a20d8dad0d6faf12b0e1ebce281ae01 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 11 Mar 2021 15:08:51 -0500 Subject: [PATCH] python lint --- deployer/src/deployer/upload.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/deployer/src/deployer/upload.py b/deployer/src/deployer/upload.py index 31c0631f3c30..644f11f1beee 100644 --- a/deployer/src/deployer/upload.py +++ b/deployer/src/deployer/upload.py @@ -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) @@ -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