Skip to content

Commit

Permalink
remove chunkSize backwards compatibility (transloadit#3830)
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Jun 27, 2022
1 parent 14dc9c6 commit 54a6b99
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/server/Uploader.js
Expand Up @@ -635,14 +635,6 @@ class Uploader {
const filename = this.uploadFileName
const { client, options } = this.options.s3

function getPartSize (chunkSize) {
// backwards compatibility https://github.com/transloadit/uppy/pull/3511#issuecomment-1050797935
// requires min 5MiB and max 5GiB partSize
// todo remove this logic in the next major semver
if (chunkSize == null || chunkSize >= 5368709120 || chunkSize <= 5242880) return undefined
return chunkSize
}

const params = {
Bucket: options.bucket,
Key: options.getKey(null, filename, this.options.metadata),
Expand All @@ -655,7 +647,8 @@ class Uploader {
if (options.acl != null) params.ACL = options.acl

const upload = client.upload(params, {
partSize: getPartSize(this.options.chunkSize),
// using chunkSize as partSize too, see https://github.com/transloadit/uppy/pull/3511
partSize: this.options.chunkSize,
})

upload.on('httpUploadProgress', ({ loaded, total }) => {
Expand Down

0 comments on commit 54a6b99

Please sign in to comment.