Skip to content

Commit

Permalink
Use pool_pre_ping in pqserver to replace stale connections
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrondel committed Nov 19, 2024
1 parent 64b1cc5 commit 928c683
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/lsst/consdb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def setup_postgres() -> sqlalchemy.Engine:
else:
pg_url = os.environ["POSTGRES_URL"]
logger.info(f"Using POSTGRES_URL {pg_url}")
engine = sqlalchemy.create_engine(pg_url, pool_recycle=3600)
engine = sqlalchemy.create_engine(pg_url, pool_recycle=3600, pool_pre_ping=True)
if pg_url.startswith("sqlite:///"):
# For unit tests
start_pos = len("sqlite:///")
Expand Down

0 comments on commit 928c683

Please sign in to comment.