Skip to content

Commit d6d2c30

Browse files
authored
Add back missing pool_pre_ping check (canada-ca#545)
* Add back missing pool_pre_ping check * Add more checks * increase max_overflow
1 parent d024bb7 commit d6d2c30

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

api/db.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
DB_PORT = os.getenv("DB_PORT")
1010
DB_NAME = os.getenv("DB_NAME")
1111

12-
# Add this in later branch -> pool_pre_ping=True,
1312
engine = create_engine(
1413
f"postgresql+psycopg2://{DB_USER}:{DB_PASS}@{DB_HOST}:{DB_PORT}/{DB_NAME}",
14+
pool_size=10,
15+
max_overflow=5,
16+
pool_recycle=300,
17+
pool_pre_ping=True,
18+
pool_use_lifo=True,
1519
)
1620

1721
db_session = scoped_session(

0 commit comments

Comments
 (0)