diff options
author | Vilem Duha <vilem.duha@gmail.com> | 2019-04-20 13:46:10 +0300 |
---|---|---|
committer | Vilem Duha <vilem.duha@gmail.com> | 2019-04-21 22:20:16 +0300 |
commit | 0ea7694caf3949a6c705c9f916469382a03ae580 (patch) | |
tree | d64d0afec7466dda92a88c6aea2b45eccd926ef0 /blenderkit/upload_bg.py | |
parent | d7e9c0f2047e139c7e2e19b5c95f5e59f92caada (diff) |
BenderKit: fix upload not reporting failed uploads correctly.
Diffstat (limited to 'blenderkit/upload_bg.py')
-rw-r--r-- | blenderkit/upload_bg.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/blenderkit/upload_bg.py b/blenderkit/upload_bg.py index 1678b194..538f9784 100644 --- a/blenderkit/upload_bg.py +++ b/blenderkit/upload_bg.py @@ -98,9 +98,11 @@ def upload_files(filepath, upload_data, files): upload_response = requests.put(upload['s3UploadUrl'], data=upload_in_chunks(f['file_path'], chunk_size, f['type']), stream=True, verify=True) - # print('upload response') - # print(upload_response.text) - uploaded = True + + if upload_response.status_code == 200: + uploaded = True + else: + bg_blender.progress('Upload failed, retry.') except Exception as e: bg_blender.progress('Upload %s failed, retrying' % f['type']) time.sleep(1) |