From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 21 Jun 2024 18:33:01 +0000 (-0700) Subject: Fix: index fresh document data after update archive file (#7057) X-Git-Tag: v2.10.2~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f9710dc8fcb9cbb6ca4a79ea16bb597728ad3c1;p=thirdparty%2Fpaperless-ngx.git Fix: index fresh document data after update archive file (#7057) --- diff --git a/src/documents/tasks.py b/src/documents/tasks.py index 5dd5c5e0f5..f3eb258b8c 100644 --- a/src/documents/tasks.py +++ b/src/documents/tasks.py @@ -285,6 +285,10 @@ def update_document_archive_file(document_id): shutil.move(parser.get_archive_path(), document.archive_path) shutil.move(thumbnail, document.thumbnail_path) + document.refresh_from_db() + logger.info( + f"Updating index for document {document_id} ({document.archive_checksum})", + ) with index.open_index_writer() as writer: index.update_document(writer, document)