diff --git a/bun.lockb b/bun.lockb index 5f01d43..f16f7c7 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 656ef7a..d83f818 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@elysiajs/html": "^1.0.2", "@elysiajs/jwt": "^1.0.2", "@elysiajs/static": "^1.0.3", - "elysia": "^1.0.21", + "elysia": "^1.0.22", "sharp": "^0.33.4" }, "module": "src/index.tsx", @@ -22,12 +22,12 @@ "@ianvs/prettier-plugin-sort-imports": "^4.2.1", "@kitajs/ts-html-plugin": "^4.0.1", "@total-typescript/ts-reset": "^0.5.1", - "@types/bun": "^1.1.2", + "@types/bun": "^1.1.3", "@types/eslint": "^8.56.10", "@types/node": "^20.12.12", "@types/ws": "^8.5.10", - "@typescript-eslint/eslint-plugin": "^7.9.0", - "@typescript-eslint/parser": "^7.9.0", + "@typescript-eslint/eslint-plugin": "^7.10.0", + "@typescript-eslint/parser": "^7.10.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", "prettier": "^3.2.5", diff --git a/src/index.tsx b/src/index.tsx index 4702c59..3433c20 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,5 @@ import { randomUUID } from "node:crypto"; -import { mkdir, unlink } from "node:fs/promises"; +import { mkdir, unlink, rmdir } from "node:fs/promises"; import cookie from "@elysiajs/cookie"; import { html } from "@elysiajs/html"; import { jwt } from "@elysiajs/jwt"; @@ -639,6 +639,9 @@ const app = new Elysia() "UPDATE jobs SET status = 'completed' WHERE id = ?", jobId.value, ); + + // delete all uploaded files in userUploadsDir + rmdir(userUploadsDir, { recursive: true }); }) .catch((error) => { console.error("Error in conversion process:", error);