mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|storage] Automatically abort multipart uploads on exceptions
This commit is contained in:
parent
16b6ac9b05
commit
85fe220470
1 changed files with 5 additions and 0 deletions
|
@ -176,6 +176,11 @@ module Fog
|
|||
part_tags << part_upload.headers["ETag"]
|
||||
end
|
||||
|
||||
rescue
|
||||
# Abort the upload & reraise
|
||||
connection.abort_multipart_upload(directory.key, key, upload_id) if upload_id
|
||||
raise
|
||||
else
|
||||
# Complete the upload
|
||||
connection.complete_multipart_upload(directory.key, key, upload_id, part_tags)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue