From bd5b1216aa323583116052604f7c842762d2883e Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 29 May 2020 10:41:01 +0100 Subject: [PATCH] Include missing keepalive_expiry configuration --- httpx/_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/httpx/_client.py b/httpx/_client.py index 2c56edc560..748c3b65c2 100644 --- a/httpx/_client.py +++ b/httpx/_client.py @@ -46,6 +46,8 @@ logger = get_logger(__name__) +KEEPALIVE_EXPIRY = 5.0 + class BaseClient: def __init__( @@ -517,6 +519,7 @@ def init_transport( ssl_context=ssl_context, max_keepalive=pool_limits.max_keepalive, max_connections=pool_limits.max_connections, + keepalive_expiry=KEEPALIVE_EXPIRY, http2=http2, ) @@ -540,6 +543,7 @@ def init_proxy_transport( ssl_context=ssl_context, max_keepalive=pool_limits.max_keepalive, max_connections=pool_limits.max_connections, + keepalive_expiry=KEEPALIVE_EXPIRY, http2=http2, ) @@ -1062,6 +1066,7 @@ def init_transport( ssl_context=ssl_context, max_keepalive=pool_limits.max_keepalive, max_connections=pool_limits.max_connections, + keepalive_expiry=KEEPALIVE_EXPIRY, http2=http2, ) @@ -1085,6 +1090,7 @@ def init_proxy_transport( ssl_context=ssl_context, max_keepalive=pool_limits.max_keepalive, max_connections=pool_limits.max_connections, + keepalive_expiry=KEEPALIVE_EXPIRY, http2=http2, )