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