lib/filestack/utils/multipart_upload_utils.rb in filestack-2.9.7 vs lib/filestack/utils/multipart_upload_utils.rb in filestack-3.0.0

- old
+ new

@@ -105,15 +105,15 @@ store: { location: storage }, } part_info[:store].merge!(options) if options - if seek_point + FilestackConfig::DEFAULT_CHUNK_SIZE > filesize - size = filesize - (seek_point) + size = if seek_point + FilestackConfig::DEFAULT_CHUNK_SIZE > filesize + filesize - (seek_point) else - size = FilestackConfig::DEFAULT_CHUNK_SIZE - end + FilestackConfig::DEFAULT_CHUNK_SIZE + end part_info[:size] = size jobs.push(part_info) part += 1 seek_point += FilestackConfig::DEFAULT_CHUNK_SIZE end @@ -273,10 +273,10 @@ apikey, filename, filesize, mimetype, start_response, nil, options, storage, intelligent ) end } - rescue + rescue StandardError raise "Upload timed out upon completion. Please try again later" end JSON.parse(response_complete.body) end