diff options
Diffstat (limited to 'server/helpers/express-utils.ts')
-rw-r--r-- | server/helpers/express-utils.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index c0d3f8f32..ede22a3cc 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts | |||
@@ -2,7 +2,7 @@ import * as express from 'express' | |||
2 | import * as multer from 'multer' | 2 | import * as multer from 'multer' |
3 | import { REMOTE_SCHEME } from '../initializers/constants' | 3 | import { REMOTE_SCHEME } from '../initializers/constants' |
4 | import { logger } from './logger' | 4 | import { logger } from './logger' |
5 | import { deleteFileAsync, generateRandomString } from './utils' | 5 | import { deleteFileAndCatch, generateRandomString } from './utils' |
6 | import { extname } from 'path' | 6 | import { extname } from 'path' |
7 | import { isArray } from './custom-validators/misc' | 7 | import { isArray } from './custom-validators/misc' |
8 | import { CONFIG } from '../initializers/config' | 8 | import { CONFIG } from '../initializers/config' |
@@ -36,15 +36,15 @@ function cleanUpReqFiles (req: { files: { [fieldname: string]: Express.Multer.Fi | |||
36 | if (!files) return | 36 | if (!files) return |
37 | 37 | ||
38 | if (isArray(files)) { | 38 | if (isArray(files)) { |
39 | (files as Express.Multer.File[]).forEach(f => deleteFileAsync(f.path)) | 39 | (files as Express.Multer.File[]).forEach(f => deleteFileAndCatch(f.path)) |
40 | return | 40 | return |
41 | } | 41 | } |
42 | 42 | ||
43 | for (const key of Object.keys(files)) { | 43 | for (const key of Object.keys(files)) { |
44 | const file = files[key] | 44 | const file = files[key] |
45 | 45 | ||
46 | if (isArray(file)) file.forEach(f => deleteFileAsync(f.path)) | 46 | if (isArray(file)) file.forEach(f => deleteFileAndCatch(f.path)) |
47 | else deleteFileAsync(file.path) | 47 | else deleteFileAndCatch(file.path) |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||