mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Bug 1574948 - Call delete after upload to avoid Contents key error. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D42700 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c63e3dbb3b
commit
a3b25b205c
@ -137,7 +137,6 @@ def s3_upload(files, key_prefix=None):
|
|||||||
defined, key names will be ``<key_prefix>/<path>``.
|
defined, key names will be ``<key_prefix>/<path>``.
|
||||||
"""
|
"""
|
||||||
s3, bucket = create_aws_session()
|
s3, bucket = create_aws_session()
|
||||||
s3_delete_missing(files, key_prefix)
|
|
||||||
|
|
||||||
def upload(f, path, bucket, key, extra_args):
|
def upload(f, path, bucket, key, extra_args):
|
||||||
# Need to flush to avoid buffering/interleaving from multiple threads.
|
# Need to flush to avoid buffering/interleaving from multiple threads.
|
||||||
@ -165,6 +164,7 @@ def s3_upload(files, key_prefix=None):
|
|||||||
fs.append(e.submit(upload, io.BytesIO(f.read()), path, bucket, key,
|
fs.append(e.submit(upload, io.BytesIO(f.read()), path, bucket, key,
|
||||||
extra_args))
|
extra_args))
|
||||||
|
|
||||||
|
s3_delete_missing(files, key_prefix)
|
||||||
# Need to do this to catch any exceptions.
|
# Need to do this to catch any exceptions.
|
||||||
for f in fs:
|
for f in fs:
|
||||||
f.result()
|
f.result()
|
||||||
|
Loading…
Reference in New Issue
Block a user