]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Sets the http timeouts equal to the task timeout, so it's either done or really done
authorTrenton Holmes <797416+stumpylog@users.noreply.github.com>
Thu, 24 Aug 2023 00:37:23 +0000 (17:37 -0700)
committerTrenton H <797416+stumpylog@users.noreply.github.com>
Thu, 24 Aug 2023 01:40:22 +0000 (18:40 -0700)
src/paperless_mail/parsers.py
src/paperless_tika/parsers.py

index 4365d21a4dd666d5a1cff4eca64f6550386da190..da9259a69ca4120f08d906029440e5751e8dba6f 100644 (file)
@@ -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
index b6a9dd621ab4420b2f15795f8e2e77d92795b00d..402a37215c0b4cdbbe1eb3bb483ef33093fc15b7 100644 (file)
@@ -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: