Skip to content

Commit

Permalink
Fix connection disconnected before idel check on cluster pool
Browse files Browse the repository at this point in the history
Derived from NoneGG/aredis#192
  • Loading branch information
alisaifee committed Jan 17, 2022
1 parent 13867d7 commit 34f90a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions coredis/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,10 @@ async def disconnect_on_idle_time_exceeded(self, connection):
):
connection.disconnect()
node = connection.node
self._available_connections[node["name"]].remove(connection)
connections = self._available_connections.get(node["name"])
if connections:
connections.remove(connection)
self._created_connections_per_node[node["name"]] -= 1

break
await asyncio.sleep(self.idle_check_interval)

Expand Down

0 comments on commit 34f90a9

Please sign in to comment.