From 326ad4d205bdf507e2238ec30b5b23e949e7ac54 Mon Sep 17 00:00:00 2001 From: Nathan Franklin Date: Wed, 30 Aug 2023 12:04:43 -0500 Subject: [PATCH] Enable pool_pre_ping and pool_reset_on_return --- geoapi/db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/geoapi/db.py b/geoapi/db.py index 16b2c8a9..cab48c49 100644 --- a/geoapi/db.py +++ b/geoapi/db.py @@ -9,7 +9,10 @@ settings.DB_HOST, settings.DB_NAME ) -engine = create_engine(CONNECTION_STRING, echo=False) +engine = create_engine(CONNECTION_STRING, + echo=False, # default value + pool_pre_ping=True, + pool_reset_on_return=True) db_session = scoped_session(sessionmaker(autocommit=False, autoflush=False,