mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-28 06:06:34 +08:00
perf: add get_all_kb_doc_count func to simplify kb.doc_num updating (#10169)
### What problem does this PR solve? Add get_all_kb_doc_count func to simplify kb.doc_num updating. ### Type of change - [x] Performance Improvement
This commit is contained in:
@ -144,8 +144,9 @@ def init_llm_factory():
|
||||
except Exception:
|
||||
pass
|
||||
break
|
||||
doc_count = DocumentService.get_all_kb_doc_count()
|
||||
for kb_id in KnowledgebaseService.get_all_ids():
|
||||
KnowledgebaseService.update_document_number_in_init(kb_id=kb_id, doc_num=DocumentService.get_kb_doc_count(kb_id))
|
||||
KnowledgebaseService.update_document_number_in_init(kb_id=kb_id, doc_num=doc_count.get(kb_id, 0))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user