Skip to content

Commit

Permalink
Fix the error in generating the idle connection list
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghanyun committed Jun 10, 2024
1 parent e987df2 commit a825a83
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion httpcore/_async/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ def _assign_requests_to_connections(self) -> List[AsyncConnectionInterface]:
closing_connections.append(connection)
elif (
connection.is_idle()
and len([connection.is_idle() for connection in self._connections])
and len(
[
connection
for connection in self._connections
if connection.is_idle()
]
)
> self._max_keepalive_connections
):
# log: "closing idle connection"
Expand Down
8 changes: 7 additions & 1 deletion httpcore/_sync/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ def _assign_requests_to_connections(self) -> List[ConnectionInterface]:
closing_connections.append(connection)
elif (
connection.is_idle()
and len([connection.is_idle() for connection in self._connections])
and len(
[
connection
for connection in self._connections
if connection.is_idle()
]
)
> self._max_keepalive_connections
):
# log: "closing idle connection"
Expand Down

0 comments on commit a825a83

Please sign in to comment.