From faed3b438e45f908013658a0e3474091824d9403 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 4 Feb 2023 13:46:19 +0000 Subject: [PATCH] fix(server): clean up file in FileServer --- packages/backend/src/server/FileServerService.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index 39bc4c1d96..4bd6d0f556 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -146,6 +146,8 @@ export class FileServerService { const url = new URL(`${this.config.mediaProxy}/static.webp`); url.searchParams.set('url', file.url); url.searchParams.set('static', '1'); + + file.cleanup(); return await reply.redirect(301, url.toString()); } else if (file.mime.startsWith('video/')) { image = await this.videoProcessingService.generateVideoThumbnail(file.path); @@ -158,6 +160,8 @@ export class FileServerService { const url = new URL(`${this.config.mediaProxy}/svg.webp`); url.searchParams.set('url', file.url); + + file.cleanup(); return await reply.redirect(301, url.toString()); } }