Standarize scan progress namespace initialization

This commit is contained in:
yangdx
2025-02-27 19:08:36 +08:00
parent 64f22966a3
commit 27500191b4

View File

@@ -278,19 +278,18 @@ class LightRAG:
) )
initialize_share_data() initialize_share_data()
need_init = try_initialize_namespace("scan_progress") need_init = try_initialize_namespace("scan_progress")
scan_progress = get_namespace_data("scan_progress") scan_progress = get_namespace_data("scan_progress")
logger.info(f"scan_progress type after init: {type(scan_progress)}") if need_init:
scan_progress.update( scan_progress.update(
{ {
"is_scanning": False, "is_scanning": False,
"current_file": "", "current_file": "",
"indexed_count": 0, "indexed_count": 0,
"total_files": 0, "total_files": 0,
"progress": 0, "progress": 0,
} }
) )
if not os.path.exists(self.working_dir): if not os.path.exists(self.working_dir):
logger.info(f"Creating working directory {self.working_dir}") logger.info(f"Creating working directory {self.working_dir}")