From a60a4babf6e0bfdd2d7e22f69bc118e5f4240428 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Wed, 25 Nov 2020 19:37:59 +0100 Subject: [PATCH] OMP_THREAD_LIMIT --- src/paperless_tesseract/parsers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py index 7e10de5c5..b181364aa 100644 --- a/src/paperless_tesseract/parsers.py +++ b/src/paperless_tesseract/parsers.py @@ -118,6 +118,9 @@ class RasterisedDocumentParser(DocumentParser): f"no DPI information is present in this image and " f"OCR_IMAGE_DPI is not set.") + # This forces tesseract to use one core per page. + os.environ['OMP_THREAD_LIMIT'] = "1" + try: ocrmypdf.ocr(**ocr_args) # success! announce results