Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fix: index fresh document data after update archive file (#7057)

shamoon0f9710dc8fcb
diff --git a/src/documents/tasks.py b/src/documents/tasks.py
index 5dd5c5e0f..f3eb258b8 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)