mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-07 16:47:13 +00:00
Performance: Scope llm index updates to actually modified documents (#13322)
* Perf: scope bulk_update_documents' LLM index refresh to the edited document ids instead of the whole library * Perf: select_related/prefetch_related for the scoped LLM index batch * Perf: select_related/prefetch_related for the full LLM index rebuild path * Fix: address Copilot review findings on LLM index scoping
This commit is contained in:
1 parent
14517062c4
commit
0e98a7f1ce
4 files changed
+52
-5
No files matched your search
@@ -401,6 +401,10 @@ class TestAIIndex(DirectoriesMixin, TestCase):
|
||||
"documents.tasks.update_llm_index",
|
||||
) as update_llm_index,
|
||||
):
|
||||
tasks.bulk_update_documents([doc.pk for doc in docs])
|
||||
doc_ids = [doc.pk for doc in docs]
|
||||
tasks.bulk_update_documents(doc_ids)
|
||||
self.assertEqual(update_document_in_llm_index.apply_async.call_count, 0)
|
||||
update_llm_index.assert_called_once()
|
||||
update_llm_index.assert_called_once_with(
|
||||
rebuild=False,
|
||||
document_ids=doc_ids,
|
||||
)
|
||||
Reference in new issue
Block a user