From a6f54e8c9e5014369ca56c4a3271f7245decef54 Mon Sep 17 00:00:00 2001 From: Timothy Farrell Date: Mon, 15 Jul 2024 11:09:50 -0500 Subject: [PATCH] Added Celery task for deleting temporary files in tasks.py. --- tasks.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tasks.py diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..7bdf9d1 --- /dev/null +++ b/tasks.py @@ -0,0 +1,7 @@ +from celery import shared_task + +@shared_task +def delete_temp_file(file_path): + """Celery task to delete a temporary file.""" + if os.path.exists(file_path): + os.remove(file_path)