changeset a3c82d74e3b9 in modules/stock_package_shipping_dpd:default
details: 
https://hg.tryton.org/modules/stock_package_shipping_dpd?cmd=changeset&node=a3c82d74e3b9
description:
        Add timeout configuration for requests

        issue10746
        review371891002
diffstat:

 configuration.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 053c2e6c30e7 -r a3c82d74e3b9 configuration.py
--- a/configuration.py  Thu Jul 22 00:04:00 2021 +0200
+++ b/configuration.py  Thu Sep 23 10:06:16 2021 +0200
@@ -13,6 +13,8 @@
 
 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 @@
     # 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)

Reply via email to