aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/image-utils.ts2
-rw-r--r--server/helpers/requests.ts8
2 files changed, 6 insertions, 4 deletions
diff --git a/server/helpers/image-utils.ts b/server/helpers/image-utils.ts
index ba57b5812..0065f4210 100644
--- a/server/helpers/image-utils.ts
+++ b/server/helpers/image-utils.ts
@@ -3,7 +3,7 @@ import * as sharp from 'sharp'
3import { unlinkPromise } from './core-utils' 3import { unlinkPromise } from './core-utils'
4 4
5async function processImage ( 5async function processImage (
6 physicalFile: Express.Multer.File, 6 physicalFile: { path: string },
7 destination: string, 7 destination: string,
8 newSize: { width: number, height: number } 8 newSize: { width: number, height: number }
9) { 9) {
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts
index eb8a12868..64e3ce663 100644
--- a/server/helpers/requests.ts
+++ b/server/helpers/requests.ts
@@ -17,11 +17,13 @@ function doRequest (
17} 17}
18 18
19function doRequestAndSaveToFile (requestOptions: request.CoreOptions & request.UriOptions, destPath: string) { 19function doRequestAndSaveToFile (requestOptions: request.CoreOptions & request.UriOptions, destPath: string) {
20 return new Bluebird<request.RequestResponse>((res, rej) => { 20 return new Bluebird<void>((res, rej) => {
21 const file = createWriteStream(destPath)
22 file.on('finish', () => res())
23
21 request(requestOptions) 24 request(requestOptions)
22 .on('response', response => res(response as request.RequestResponse))
23 .on('error', err => rej(err)) 25 .on('error', err => rej(err))
24 .pipe(createWriteStream(destPath)) 26 .pipe(file)
25 }) 27 })
26} 28}
27 29