mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Sets the http timeouts equal to the task timeout, so it's either done or really done
This commit is contained in:
parent
8f2715e437
commit
fe1f88ce5d
@ -215,7 +215,11 @@ class MailDocumentParser(DocumentParser):
|
|||||||
file_multi_part[2],
|
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
|
response.raise_for_status() # ensure we notice bad responses
|
||||||
|
|
||||||
archive_path.write_bytes(response.content)
|
archive_path.write_bytes(response.content)
|
||||||
@ -330,7 +334,7 @@ class MailDocumentParser(DocumentParser):
|
|||||||
files=files,
|
files=files,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
data=data,
|
data=data,
|
||||||
timeout=30.0,
|
timeout=settings.CELERY_TASK_TIME_LIMIT,
|
||||||
)
|
)
|
||||||
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:
|
||||||
@ -409,7 +413,12 @@ class MailDocumentParser(DocumentParser):
|
|||||||
file_multi_part[2],
|
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
|
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
|
||||||
|
@ -100,7 +100,7 @@ class TikaDocumentParser(DocumentParser):
|
|||||||
files=files,
|
files=files,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
data=data,
|
data=data,
|
||||||
timeout=30.0,
|
timeout=settings.CELERY_TASK_TIME_LIMIT,
|
||||||
)
|
)
|
||||||
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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user