File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ def connection(self):
206206 if not self ._connections .acquire (self ._blocking ):
207207 raise TooManyConnections
208208 try :
209- con = self ._cache .get ( 0 )
209+ con = self ._cache .get_nowait ( )
210210 except Empty :
211211 con = self .steady_connection ()
212212 return PooledPgConnection (self , con )
@@ -222,7 +222,7 @@ def cache(self, con):
222222 con .rollback () # rollback a possible transaction
223223 except Exception :
224224 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
226226 except Full :
227227 con .close ()
228228 if self ._connections :
@@ -232,7 +232,7 @@ def close(self):
232232 """Close all connections in the pool."""
233233 while 1 :
234234 try :
235- con = self ._cache .get ( 0 )
235+ con = self ._cache .get_nowait ( )
236236 try :
237237 con .close ()
238238 except Exception :
You can’t perform that action at this time.
0 commit comments