mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Updates the httpx timeout to be 30s for all operations
This commit is contained in:
parent
05188aed6d
commit
74fe7c586b
@ -218,7 +218,7 @@ class MailDocumentParser(DocumentParser):
|
|||||||
file_multi_part[2],
|
file_multi_part[2],
|
||||||
)
|
)
|
||||||
|
|
||||||
response = httpx.post(url_merge, files=pdf_collection)
|
response = httpx.post(url_merge, files=pdf_collection, timeout=30.0)
|
||||||
response.raise_for_status() # ensure we notice bad responses
|
response.raise_for_status() # ensure we notice bad responses
|
||||||
|
|
||||||
archive_path.write_bytes(response.content)
|
archive_path.write_bytes(response.content)
|
||||||
@ -336,6 +336,7 @@ class MailDocumentParser(DocumentParser):
|
|||||||
files=files,
|
files=files,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
data=data,
|
data=data,
|
||||||
|
timeout=30.0,
|
||||||
)
|
)
|
||||||
response.raise_for_status() # ensure we notice bad responses
|
response.raise_for_status() # ensure we notice bad responses
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
@ -414,11 +415,7 @@ class MailDocumentParser(DocumentParser):
|
|||||||
file_multi_part[2],
|
file_multi_part[2],
|
||||||
)
|
)
|
||||||
|
|
||||||
response = httpx.post(
|
response = httpx.post(url, files=files, data=data, timeout=30.0)
|
||||||
url,
|
|
||||||
files=files,
|
|
||||||
data=data,
|
|
||||||
)
|
|
||||||
response.raise_for_status() # ensure we notice bad responses
|
response.raise_for_status() # ensure we notice bad responses
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
raise ParseError(f"Error while converting document to PDF: {err}") from err
|
raise ParseError(f"Error while converting document to PDF: {err}") from err
|
||||||
|
@ -96,7 +96,13 @@ class TikaDocumentParser(DocumentParser):
|
|||||||
data["pdfFormat"] = "PDF/A-3b"
|
data["pdfFormat"] = "PDF/A-3b"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.post(url, files=files, headers=headers, data=data)
|
response = httpx.post(
|
||||||
|
url,
|
||||||
|
files=files,
|
||||||
|
headers=headers,
|
||||||
|
data=data,
|
||||||
|
timeout=30.0,
|
||||||
|
)
|
||||||
response.raise_for_status() # ensure we notice bad responses
|
response.raise_for_status() # ensure we notice bad responses
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
raise ParseError(
|
raise ParseError(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user