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 9, 2024
1 parent e987df2 commit 077b50d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion httpcore/_async/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ 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
2 changes: 1 addition & 1 deletion httpcore/_sync/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ 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 077b50d

Please sign in to comment.