Prechádzať zdrojové kódy

s3: Implement really aborting multipart uploads

Renée Kooi 7 rokov pred
rodič
commit
052a87dca4

+ 2 - 2
src/plugins/AwsS3/Multipart.js

@@ -220,7 +220,7 @@ module.exports = class AwsS3Multipart extends Plugin {
 
       this.uppy.on('file-removed', (removed) => {
         if (file.id !== removed.id) return
-        upload.abort()
+        upload.abort({ really: true })
         resolve(`upload ${removed.id} was removed`)
       })
 
@@ -238,7 +238,7 @@ module.exports = class AwsS3Multipart extends Plugin {
       })
 
       this.uppy.on('cancel-all', () => {
-        upload.abort()
+        upload.abort({ really: true })
       })
 
       this.uppy.on('resume-all', () => {

+ 4 - 1
src/plugins/AwsS3/MultipartUploader.js

@@ -226,6 +226,7 @@ class MultipartUploader {
 
   _abortUpload () {
     this.options.abortMultipartUpload({
+      key: this.key,
       uploadId: this.uploadId
     })
   }
@@ -243,7 +244,9 @@ class MultipartUploader {
     this.isPaused = true
   }
 
-  abort (really = false) {
+  abort (opts = {}) {
+    const really = opts.really || false
+
     if (!really) return this.pause()
 
     this._abortUpload()