mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-24 08:38:55 +00:00
Performance: resolve index-write permissions and effective content in bulk (#13869)
* fix(search): resolve index-write permissions and effective content in bulk Add WriteBatch.add_or_update_ids() and use it in bulk_update_documents and trash restore, cutting index writes from ~8 queries per document to a constant handful per batch * Always these new ones with xdist, try a better condition
This commit is contained in:
1 parent
d52cc1b609
commit
f5ff18326d
4 files changed
+233
-5
No files matched your search
@@ -5469,8 +5469,7 @@ class TrashView(ListModelMixin, PassUserMixin):
|
||||
from documents.search import get_backend
|
||||
|
||||
with get_backend().batch_update() as batch:
|
||||
for doc in restored:
|
||||
batch.add_or_update(doc)
|
||||
batch.add_or_update_ids([doc.pk for doc in restored])
|
||||
elif action == "empty":
|
||||
if doc_ids is None:
|
||||
doc_ids = [doc.id for doc in docs]
|
||||
|
||||
Reference in new issue
Block a user