possibly fixed race-condition in upload

pull/29/head
tycrek 3 years ago
parent fd4ef62642
commit 3b80b024ab
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -24,7 +24,7 @@ function saveFile(req) {
return new Promise((resolve, reject) =>
fs.ensureDir(getDatedDirname())
.then(() => fs.createWriteStream(req.file.path.concat('.temp')))
.then((stream) => req.file.stream.pipe(stream).on('finish', log.debug('Temp file', 'saved').callback(resolve)).on('error', reject))
.then((stream) => req.file.stream.pipe(stream).on('finish', () => log.debug('Temp file', 'saved').callback(resolve)).on('error', reject))
.catch(reject));
}

Loading…
Cancel
Save