From c24c2ff2f603b499ecc4996d970c2f5baef775f9 Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 30 Jul 2025 14:23:08 +0800 Subject: [PATCH] Remove deprecated temp file saving function - Delete unused save_temp_file function --- lightrag/api/routers/document_routes.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lightrag/api/routers/document_routes.py b/lightrag/api/routers/document_routes.py index 61ad4408..556c7ac9 100644 --- a/lightrag/api/routers/document_routes.py +++ b/lightrag/api/routers/document_routes.py @@ -899,30 +899,6 @@ async def pipeline_index_texts( await rag.apipeline_process_enqueue_documents() -# TODO: deprecate after /insert_file is removed -async def save_temp_file(input_dir: Path, file: UploadFile = File(...)) -> Path: - """Save the uploaded file to a temporary location - - Args: - file: The uploaded file - - Returns: - Path: The path to the saved file - """ - # Generate unique filename to avoid conflicts - timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") - unique_filename = f"{temp_prefix}{timestamp}_{file.filename}" - - # Create a temporary file to save the uploaded content - temp_path = input_dir / "temp" / unique_filename - temp_path.parent.mkdir(exist_ok=True) - - # Save the file - with open(temp_path, "wb") as buffer: - shutil.copyfileobj(file.file, buffer) - return temp_path - - async def run_scanning_process( rag: LightRAG, doc_manager: DocumentManager, track_id: str = None ):