From b5b36ba287ff510635d242f2b95bc55238a2b347 Mon Sep 17 00:00:00 2001 From: Takumi Akimoto Date: Sun, 5 Jul 2026 23:29:38 +0900 Subject: [PATCH] file: Force GC after uploading images --- Dockerfile | 2 +- src/lib/file.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7bbe43f..04fb10c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,4 @@ EXPOSE 8000 ARG GIT_REVISION ENV DENO_DEPLOYMENT_ID=${GIT_REVISION} -CMD ["serve", "--allow-env", "--allow-net", "--allow-read", "/app/server.js"] +CMD ["serve", "--allow-env", "--allow-net", "--allow-read", "--v8-flags=--expose-gc", "/app/server.js"] diff --git a/src/lib/file.ts b/src/lib/file.ts index 34f5a80..2a952a6 100644 --- a/src/lib/file.ts +++ b/src/lib/file.ts @@ -12,6 +12,10 @@ import { client } from "./blueskyClient.ts" const TRAQ_IMAGE_MAX_PIXELS = 2560 * 1600 +declare global { + var gc: (() => void) | undefined +} + interface UploadImageParams { accessToken: string did: Did @@ -62,6 +66,10 @@ export const uploadImages = async ( } imageIds.push(uploadedFile.id) + + if (typeof gc === "function") { + gc() + } } return imageIds -- 2.51.2