mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-08-01 19:00:09 +03:00
Import datetime into _prune function
This commit is contained in:
parent
75fad2d361
commit
5c31d2dbc2
|
@ -298,6 +298,7 @@ class CachingConnectionPool(AbstractConnectionPool):
|
||||||
|
|
||||||
def _prune(self):
|
def _prune(self):
|
||||||
"""Remove any expired connections from the connection pool."""
|
"""Remove any expired connections from the connection pool."""
|
||||||
|
from datetime import datetime, timedelta
|
||||||
junk_expirations = []
|
junk_expirations = []
|
||||||
for obj_id, exp_time in self._expirations.items():
|
for obj_id, exp_time in self._expirations.items():
|
||||||
# _expirations is an ordered dict, so results should be in chronological order
|
# _expirations is an ordered dict, so results should be in chronological order
|
||||||
|
|
Loading…
Reference in New Issue
Block a user