]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Include missing keepalive_expiry configuration (#1005)
authorTom Christie <tom@tomchristie.com>
Fri, 29 May 2020 10:10:36 +0000 (11:10 +0100)
committerGitHub <noreply@github.com>
Fri, 29 May 2020 10:10:36 +0000 (11:10 +0100)
httpx/_client.py

index 2c56edc560ebb5ab012edbee540d7f36085fe1fd..748c3b65c286f1f8a90fb7dd90d215eaae921485 100644 (file)
@@ -46,6 +46,8 @@ from ._utils import (
 
 logger = get_logger(__name__)
 
+KEEPALIVE_EXPIRY = 5.0
+
 
 class BaseClient:
     def __init__(
@@ -517,6 +519,7 @@ class Client(BaseClient):
             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 @@ class Client(BaseClient):
             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 @@ class AsyncClient(BaseClient):
             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 @@ class AsyncClient(BaseClient):
             ssl_context=ssl_context,
             max_keepalive=pool_limits.max_keepalive,
             max_connections=pool_limits.max_connections,
+            keepalive_expiry=KEEPALIVE_EXPIRY,
             http2=http2,
         )