From 16f27c13bbc1c0e5fa2316f3db11d0918524053b Mon Sep 17 00:00:00 2001 From: C4illin Date: Sat, 1 Feb 2025 21:09:48 +0100 Subject: [PATCH] fix: don't crash if file is not found --- src/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index fd85f0a..33600c6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1420,8 +1420,14 @@ const clearJobs = () => { for (const job of jobs) { // delete the directories - rmSync(`${outputDir}${job.user_id}/${job.id}`, { recursive: true }); - rmSync(`${uploadsDir}${job.user_id}/${job.id}`, { recursive: true }); + rmSync(`${outputDir}${job.user_id}/${job.id}`, { + recursive: true, + force: true, + }); + rmSync(`${uploadsDir}${job.user_id}/${job.id}`, { + recursive: true, + force: true, + }); // delete the job db.query("DELETE FROM jobs WHERE id = ?").run(job.id);