diff --git a/src/paperless_mail/parsers.py b/src/paperless_mail/parsers.py index 4365d21a4..da9259a69 100644 --- a/src/paperless_mail/parsers.py +++ b/src/paperless_mail/parsers.py @@ -215,7 +215,11 @@ class MailDocumentParser(DocumentParser): file_multi_part[2], ) - response = httpx.post(url_merge, files=pdf_collection, timeout=30.0) + response = httpx.post( + url_merge, + files=pdf_collection, + timeout=settings.CELERY_TASK_TIME_LIMIT, + ) response.raise_for_status() # ensure we notice bad responses archive_path.write_bytes(response.content) @@ -330,7 +334,7 @@ class MailDocumentParser(DocumentParser): files=files, headers=headers, data=data, - timeout=30.0, + timeout=settings.CELERY_TASK_TIME_LIMIT, ) response.raise_for_status() # ensure we notice bad responses except Exception as err: @@ -409,7 +413,12 @@ class MailDocumentParser(DocumentParser): file_multi_part[2], ) - response = httpx.post(url, files=files, data=data, timeout=30.0) + response = httpx.post( + url, + files=files, + data=data, + timeout=settings.CELERY_TASK_TIME_LIMIT, + ) response.raise_for_status() # ensure we notice bad responses except Exception as err: raise ParseError(f"Error while converting document to PDF: {err}") from err diff --git a/src/paperless_tika/parsers.py b/src/paperless_tika/parsers.py index b6a9dd621..402a37215 100644 --- a/src/paperless_tika/parsers.py +++ b/src/paperless_tika/parsers.py @@ -100,7 +100,7 @@ class TikaDocumentParser(DocumentParser): files=files, headers=headers, data=data, - timeout=30.0, + timeout=settings.CELERY_TASK_TIME_LIMIT, ) response.raise_for_status() # ensure we notice bad responses except Exception as err: