File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/smithy-http/src/smithy_http/aio Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -273,13 +273,15 @@ async def _get_connection(
273273 ) -> "crt_http.HttpClientConnection" :
274274 # TODO: Use CRT connection pooling instead of this basic kind
275275 connection_key = (url .scheme , url .host , url .port )
276- if connection_key in self ._connections :
277- return self ._connections [connection_key ]
278- else :
279- connection = await self ._create_connection (url )
280- self ._connections [connection_key ] = connection
276+ connection = self ._connections .get (connection_key )
277+
278+ if connection and connection .is_open ():
281279 return connection
282280
281+ connection = await self ._create_connection (url )
282+ self ._connections [connection_key ] = connection
283+ return connection
284+
283285 def _build_new_connection (
284286 self , url : core_interfaces .URI
285287 ) -> ConcurrentFuture ["crt_http.HttpClientConnection" ]:
You can’t perform that action at this time.
0 commit comments