summaryrefslogtreecommitdiff
path: root/lib/object_storage/direct_upload.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/object_storage/direct_upload.rb')
-rw-r--r--lib/object_storage/direct_upload.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/object_storage/direct_upload.rb b/lib/object_storage/direct_upload.rb
index b5864382299..3a8fa51e198 100644
--- a/lib/object_storage/direct_upload.rb
+++ b/lib/object_storage/direct_upload.rb
@@ -184,15 +184,20 @@ module ObjectStorage
private
def rounded_multipart_part_size
- # round multipart_part_size up to minimum_mulitpart_size
+ # round multipart_part_size up to minimum_multipart_size
(multipart_part_size + MINIMUM_MULTIPART_SIZE - 1) / MINIMUM_MULTIPART_SIZE * MINIMUM_MULTIPART_SIZE
end
def multipart_part_size
+ return MINIMUM_MULTIPART_SIZE if maximum_size == 0
+
maximum_size / number_of_multipart_parts
end
def number_of_multipart_parts
+ # If we don't have max length, we can only assume the file is as large as possible.
+ return MAXIMUM_MULTIPART_PARTS if maximum_size == 0
+
[
# round maximum_size up to minimum_mulitpart_size
(maximum_size + MINIMUM_MULTIPART_SIZE - 1) / MINIMUM_MULTIPART_SIZE,
@@ -201,7 +206,7 @@ module ObjectStorage
end
def requires_multipart_upload?
- config.aws? && !has_length
+ config.aws? && !has_length && !use_workhorse_s3_client?
end
def upload_id