File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ def connection(self):
206
206
if not self ._connections .acquire (self ._blocking ):
207
207
raise TooManyConnections
208
208
try :
209
- con = self ._cache .get ( 0 )
209
+ con = self ._cache .get_nowait ( )
210
210
except Empty :
211
211
con = self .steady_connection ()
212
212
return PooledPgConnection (self , con )
@@ -222,7 +222,7 @@ def cache(self, con):
222
222
con .rollback () # rollback a possible transaction
223
223
except Exception :
224
224
pass
225
- self ._cache .put (con , 0 ) # and then put it back into the cache
225
+ self ._cache .put_nowait (con ) # and then put it back into the cache
226
226
except Full :
227
227
con .close ()
228
228
if self ._connections :
@@ -232,7 +232,7 @@ def close(self):
232
232
"""Close all connections in the pool."""
233
233
while 1 :
234
234
try :
235
- con = self ._cache .get ( 0 )
235
+ con = self ._cache .get_nowait ( )
236
236
try :
237
237
con .close ()
238
238
except Exception :
You can’t perform that action at this time.
0 commit comments