File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -1167,24 +1167,16 @@ def __init__(
11671167 self ._condition = asyncio .Condition ()
11681168 self .timeout = timeout
11691169
1170- async def get_connection (self , command_name , * keys , ** options ):
1170+ def get_available_connection (self ):
11711171 """Gets a connection from the pool, blocking until one is available"""
11721172 try :
11731173 async with self ._condition :
11741174 async with async_timeout (self .timeout ):
11751175 await self ._condition .wait_for (self .can_get_connection )
1176- connection = super ().get_available_connection ()
1176+ return super ().get_available_connection ()
11771177 except asyncio .TimeoutError as err :
11781178 raise ConnectionError ("No connection available." ) from err
11791179
1180- # We now perform the connection check outside of the lock.
1181- try :
1182- await self .ensure_connection (connection )
1183- return connection
1184- except BaseException :
1185- await self .release (connection )
1186- raise
1187-
11881180 async def release (self , connection : AbstractConnection ):
11891181 """Releases the connection back to the pool."""
11901182 async with self ._condition :
You can’t perform that action at this time.
0 commit comments