From bb40478e5854994cd140402bffb1a19339b05ee9 Mon Sep 17 00:00:00 2001 From: Minkyu Lee Date: Mon, 8 Jul 2024 21:41:44 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20DB=20Lost=20connection=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B4=EA=B2=B0=EC=9D=84=20=EC=9C=84=ED=95=B4=20?= =?UTF-8?q?pool=20=EA=B4=80=EB=A0=A8=20=EC=98=B5=EC=85=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waffledotcom/src/database/connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/waffledotcom/src/database/connection.py b/waffledotcom/src/database/connection.py index a46bbdb..97c346b 100644 --- a/waffledotcom/src/database/connection.py +++ b/waffledotcom/src/database/connection.py @@ -15,7 +15,10 @@ class DBSessionFactory(metaclass=SingletonMeta): def __init__(self): self._engine: sqlalchemy.Engine = sqlalchemy.create_engine( - db_config.url, echo=settings.is_local + db_config.url, + echo=settings.is_local, + pool_recycle=28000, + pool_pre_ping=True, ) self._session_maker = orm.sessionmaker( bind=self._engine, expire_on_commit=False