Refactor document scanning progress share variable initialization
This commit is contained in:
@@ -267,8 +267,20 @@ class LightRAG:
|
||||
_storages_status: StoragesStatus = field(default=StoragesStatus.NOT_CREATED)
|
||||
|
||||
def __post_init__(self):
|
||||
from lightrag.kg.shared_storage import initialize_share_data
|
||||
from lightrag.kg.shared_storage import initialize_share_data, try_initialize_namespace, get_namespace_data
|
||||
initialize_share_data()
|
||||
need_init = try_initialize_namespace("scan_progress")
|
||||
scan_progress = get_namespace_data("scan_progress")
|
||||
if need_init:
|
||||
scan_progress.update(
|
||||
{
|
||||
"is_scanning": False,
|
||||
"current_file": "",
|
||||
"indexed_count": 0,
|
||||
"total_files": 0,
|
||||
"progress": 0,
|
||||
}
|
||||
)
|
||||
|
||||
os.makedirs(os.path.dirname(self.log_file_path), exist_ok=True)
|
||||
set_logger(self.log_file_path, self.log_level)
|
||||
|
Reference in New Issue
Block a user