From d3d15d7ba90a62799c182bbedd2116eadc3d84fa Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum Date: Mon, 23 Dec 2024 21:00:51 +0100 Subject: [PATCH] adapt timeout to load balancer --- .../commands/ingest_xmlupload/bulk_ingest_client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py b/src/dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py index a44b20f14..9c40ca4fd 100644 --- a/src/dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py +++ b/src/dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py @@ -58,10 +58,14 @@ def upload_file( self, filepath: Path, ) -> UploadFailure | None: - """Uploads a file to the ingest server.""" + """ + Uploads a file to the ingest server. + The load balancer on DSP servers currently has a timeout of 60s, so we need to use a timeout of 58s. + See https://github.com/dasch-swiss/dsp-tools/pull/1335/files#r1882508057 + """ + timeout = 58 url = self._build_url_for_bulk_ingest_ingest_route(filepath) headers = {"Content-Type": "application/octet-stream"} - timeout = 1000 err_msg = f"Failed to upload '{filepath}' to '{url}'." try: logger.debug(f"REQUEST: POST to {url}, timeout: {timeout}, headers: {headers}")