From d509ecec0d5fc4e4e7db18200c3923f72b355073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 Sep 2021 10:06:16 +0200 Subject: [PATCH] Add timeout configuration for requests issue10746 review371891002 --- configuration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configuration.py b/configuration.py index 17312b9978..4c68eb8d3d 100644 --- a/configuration.py +++ b/configuration.py @@ -13,6 +13,8 @@ SERVER_URLS = { LOGIN_SERVICE = 'LoginService/V2_0?wsdl' SHIPMENT_SERVICE = 'ShipmentService/V3_2?wsdl' +TIMEOUT = config.get( + 'stock_package_shipping_dpd', 'requests_timeout', default=300) def get_client(server, service): @@ -22,6 +24,6 @@ def get_client(server, service): # Disable the cache for testing because zeep's bug # https://github.com/mvantellingen/python-zeep/issues/48 # which makes testing environments fail - transport = (Transport(cache=None) + transport = (Transport(cache=None, operation_timeout=TIMEOUT) if url.startswith(SERVER_URLS['testing']) else None) return Client(url, transport=transport)