Skip to content

Commit

Permalink
Fix typo in ConnectionPool and AsyncConnectionPool (#908)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Christie <tom@tomchristie.com>
  • Loading branch information
n-thumann and tomchristie authored May 17, 2024
1 parent a8f8098 commit c96fdf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions httpcore/_async/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _assign_requests_to_connections(self) -> List[AsyncConnectionInterface]:
queued_requests = [request for request in self._requests if request.is_queued()]
for pool_request in queued_requests:
origin = pool_request.request.url.origin
avilable_connections = [
available_connections = [
connection
for connection in self._connections
if connection.can_handle_request(origin) and connection.is_available()
Expand All @@ -277,9 +277,9 @@ def _assign_requests_to_connections(self) -> List[AsyncConnectionInterface]:
# 2. We can create a new connection to handle the request.
# 3. We can close an idle connection and then create a new connection
# to handle the request.
if avilable_connections:
if available_connections:
# log: "reusing existing connection"
connection = avilable_connections[0]
connection = available_connections[0]
pool_request.assign_to_connection(connection)
elif len(self._connections) < self._max_connections:
# log: "creating new connection"
Expand Down
6 changes: 3 additions & 3 deletions httpcore/_sync/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _assign_requests_to_connections(self) -> List[ConnectionInterface]:
queued_requests = [request for request in self._requests if request.is_queued()]
for pool_request in queued_requests:
origin = pool_request.request.url.origin
avilable_connections = [
available_connections = [
connection
for connection in self._connections
if connection.can_handle_request(origin) and connection.is_available()
Expand All @@ -277,9 +277,9 @@ def _assign_requests_to_connections(self) -> List[ConnectionInterface]:
# 2. We can create a new connection to handle the request.
# 3. We can close an idle connection and then create a new connection
# to handle the request.
if avilable_connections:
if available_connections:
# log: "reusing existing connection"
connection = avilable_connections[0]
connection = available_connections[0]
pool_request.assign_to_connection(connection)
elif len(self._connections) < self._max_connections:
# log: "creating new connection"
Expand Down

0 comments on commit c96fdf7

Please sign in to comment.