transloadit: Mark postprocessing as complete if an error occurred

This way stray postprocessing state doesn't interfere in future uploads.
This commit is contained in:
Renée Kooi 2017-06-08 13:36:30 +02:00
parent d96e589a40
commit 7f6cb7a65d
No known key found for this signature in database
GPG key ID: 30516CF2A8E63718

View file

@ -273,6 +273,11 @@ module.exports = class Transloadit extends Plugin {
// Remove this handler once we find the assembly we needed.
this.core.emitter.off('transloadit:assembly-error', onAssemblyError)
// Clear postprocessing state for all our files.
fileIDs.forEach((fileID) => {
this.core.emit('core:postprocess-complete', fileID)
})
// Reject the `afterUpload()` promise.
reject(error)
}