from celery import shared_task import os @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)