File tree 1 file changed +2
-10
lines changed
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -1167,24 +1167,16 @@ def __init__(
1167
1167
self ._condition = asyncio .Condition ()
1168
1168
self .timeout = timeout
1169
1169
1170
- async def get_connection (self , command_name , * keys , ** options ):
1170
+ def get_available_connection (self ):
1171
1171
"""Gets a connection from the pool, blocking until one is available"""
1172
1172
try :
1173
1173
async with self ._condition :
1174
1174
async with async_timeout (self .timeout ):
1175
1175
await self ._condition .wait_for (self .can_get_connection )
1176
- connection = super ().get_available_connection ()
1176
+ return super ().get_available_connection ()
1177
1177
except asyncio .TimeoutError as err :
1178
1178
raise ConnectionError ("No connection available." ) from err
1179
1179
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
-
1188
1180
async def release (self , connection : AbstractConnection ):
1189
1181
"""Releases the connection back to the pool."""
1190
1182
async with self ._condition :
You can’t perform that action at this time.
0 commit comments