feat(lightrag): improve job name display with file path and count

Replace generic "indexing files" with dynamic job name showing truncated file path and total file count.
This commit is contained in:
yangdx
2025-03-26 12:32:52 +08:00
parent d7c0b420b9
commit 57143fedcc

View File

@@ -842,10 +842,17 @@ class LightRAG:
logger.info("No documents to process") logger.info("No documents to process")
return return
# Get first document's file path and total count for job name
first_doc_id, first_doc = next(iter(to_process_docs.items()))
first_doc_path = first_doc.file_path
path_prefix = first_doc_path[:20] + ("..." if len(first_doc_path) > 20 else "")
total_files = len(to_process_docs)
job_name = f"{path_prefix}[{total_files} files]"
pipeline_status.update( pipeline_status.update(
{ {
"busy": True, "busy": True,
"job_name": "indexing files", "job_name": job_name,
"job_start": datetime.now().isoformat(), "job_start": datetime.now().isoformat(),
"docs": 0, "docs": 0,
"batchs": 0, "batchs": 0,