From 1b523b161186be57c40c58864d3d0d829e6c8995 Mon Sep 17 00:00:00 2001 From: Joel Mathew Thomas <90510078+joelmathewthomas@users.noreply.github.com> Date: Thu, 20 Mar 2025 22:11:22 +0530 Subject: [PATCH] clean server storage on start --- api/api/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/api/views.py b/api/api/views.py index 1655b7d..6cb298c 100644 --- a/api/api/views.py +++ b/api/api/views.py @@ -1,4 +1,5 @@ import os +import shutil import uuid import zipfile from django.http import FileResponse, HttpResponse @@ -18,6 +19,7 @@ from freqsplit.input.format_checker import is_supported_format UPLOAD_DIR = "/tmp/freqsplit" # Ensure the temp directory exists +shutil.rmtree(UPLOAD_DIR) os.makedirs(UPLOAD_DIR, exist_ok=True) # Endpoint to ping server