From 3b80b024ab0c000d67475006363c1207b1b1197e Mon Sep 17 00:00:00 2001 From: tycrek Date: Sat, 10 Jul 2021 10:03:08 -0600 Subject: [PATCH] possibly fixed race-condition in upload --- storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage.js b/storage.js index dbd81b5..1a4d53b 100644 --- a/storage.js +++ b/storage.js @@ -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)); }