Skip to content

Commit 1cb7602

Browse files
committed
solving db connection expirary problem
1 parent dd45c9c commit 1cb7602

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- dev
8+
- fix_db_connection_expiry
89

910
jobs:
1011
build-and-deploy:

app/utils/database/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self, url: str, tables: list):
1515

1616
def init_database(self):
1717
try:
18-
self.engine = create_engine(self.url, echo=True)
18+
self.engine = create_engine(self.url, echo=True, pool_pre_ping=True, pool_recycle=1800, pool_timeout=30)
1919
metadata = MetaData()
2020
metadata.reflect(self.engine, only=self.tables)
2121
self.Base.prepare(self.engine, reflect=True)

0 commit comments

Comments
 (0)