Browse Source

multipart/tus: Remove Promise.all() calls with unused results, closes #121

René Kooi 8 years ago
parent
commit
bb55741fc9
2 changed files with 3 additions and 18 deletions
  1. 1 6
      src/plugins/Multipart.js
  2. 2 12
      src/plugins/Tus10.js

+ 1 - 6
src/plugins/Multipart.js

@@ -114,15 +114,10 @@ module.exports = class Multipart extends Plugin {
       }
     })
 
-    const uploaders = []
     filesForUpload.forEach((file, i) => {
       const current = parseInt(i, 10) + 1
       const total = filesForUpload.length
-      uploaders.push(this.upload(file, current, total))
-    })
-
-    return Promise.all(uploaders).then((result) => {
-      this.core.log('Multipart has finished uploading!')
+      this.upload(file, current, total)
     })
 
     //   if (this.opts.bundle) {

+ 2 - 12
src/plugins/Tus10.js

@@ -257,26 +257,16 @@ module.exports = class Tus10 extends Plugin {
       return
     }
 
-    const uploaders = []
     files.forEach((file, index) => {
       const current = parseInt(index, 10) + 1
       const total = files.length
 
       if (!file.isRemote) {
-        uploaders.push(this.upload(file, current, total))
+        this.upload(file, current, total)
       } else {
-        uploaders.push(this.uploadRemote(file, current, total))
+        this.uploadRemote(file, current, total)
       }
     })
-
-    return Promise.all(uploaders)
-      .then(() => {
-        this.core.log('All files uploaded')
-        return { uploadedCount: files.length }
-      })
-      .catch((err) => {
-        this.core.log('Upload error: ' + err)
-      })
   }
 
   selectForUpload (files) {