A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fixes handling the case where there is no status reported from celery (due to external termination of the worker) (#12040)
Trenton H6a87c3f4dd9b
diff --git a/src/documents/parsers.py b/src/documents/parsers.pyindex b59e7d6b7..372cf0491 100644--- a/src/documents/parsers.py+++ b/src/documents/parsers.py@@ -150,7 +150,15 @@ def run_convert() -> None:environment = os.environ.copy()if settings.CONVERT_MEMORY_LIMIT:+ # MAGICK_MEMORY_LIMIT sets the maximum amount of RAM the pixel cache can use.+ # MAGICK_MAP_LIMIT sets the maximum amount of memory-mapped I/O allowed.+ #+ # For large-format documents ImageMagick will hit the RAM limit and+ # immediately try to "map" the remaining data. If MAGICK_MAP_LIMIT isn't+ # also set, the process may trigger an OOM kill because the default+ # system/policy map limit is often too restrictive for these massive bitmaps.environment["MAGICK_MEMORY_LIMIT"] = settings.CONVERT_MEMORY_LIMIT+ environment["MAGICK_MAP_LIMIT"] = settings.CONVERT_MEMORY_LIMITif settings.CONVERT_TMPDIR:environment["MAGICK_TMPDIR"] = settings.CONVERT_TMPDIRdiff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.pyindex 47ebab6f5..41fb03d9e 100644--- a/src/documents/signals/handlers.py+++ b/src/documents/signals/handlers.py@@ -936,7 +936,7 @@ def task_postrun_handler(task_instance = PaperlessTask.objects.filter(task_id=task_id).first()if task_instance is not None:- task_instance.status = state+ task_instance.status = state or states.FAILUREtask_instance.result = retvaltask_instance.date_done = timezone.now()task_instance.save()