diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/requests.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts index 60c94da81..8dda6c039 100644 --- a/server/helpers/requests.ts +++ b/server/helpers/requests.ts | |||
@@ -50,7 +50,14 @@ async function downloadImage (url: string, destDir: string, destName: string, si | |||
50 | await doRequestAndSaveToFile({ method: 'GET', uri: url }, tmpPath) | 50 | await doRequestAndSaveToFile({ method: 'GET', uri: url }, tmpPath) |
51 | 51 | ||
52 | const destPath = join(destDir, destName) | 52 | const destPath = join(destDir, destName) |
53 | await processImage({ path: tmpPath }, destPath, size) | 53 | |
54 | try { | ||
55 | await processImage({ path: tmpPath }, destPath, size) | ||
56 | } catch (err) { | ||
57 | await remove(tmpPath) | ||
58 | |||
59 | throw err | ||
60 | } | ||
54 | } | 61 | } |
55 | 62 | ||
56 | // --------------------------------------------------------------------------- | 63 | // --------------------------------------------------------------------------- |