Set in_process flag during update_document_content_maybe_archive_file

This commit is contained in:
shamoon
2025-08-26 00:59:56 -07:00
parent fda29f51c3
commit d190b50032

View File

@@ -250,6 +250,7 @@ def update_document_content_maybe_archive_file(document_id):
it exists. it exists.
""" """
document = Document.objects.get(id=document_id) document = Document.objects.get(id=document_id)
Document.objects.filter(pk=document_id).update(in_process=True)
mime_type = document.mime_type mime_type = document.mime_type
@@ -349,6 +350,7 @@ def update_document_content_maybe_archive_file(document_id):
) )
finally: finally:
parser.cleanup() parser.cleanup()
Document.objects.filter(pk=document_id).update(in_process=False)
@shared_task @shared_task