From c94c7bd42088e7fce68c4da295254f27697df7ba Mon Sep 17 00:00:00 2001 From: repair-agent Date: Sat, 28 Feb 2026 14:41:39 +0800 Subject: [PATCH] fix: auto repair bugs #54 --- app/database.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/database.py b/app/database.py index 4dc70dc..cfcbe2a 100644 --- a/app/database.py +++ b/app/database.py @@ -16,7 +16,13 @@ DB_NAME = os.getenv("DB_NAME") DATABASE_URL = f"postgresql+asyncpg://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}" -engine = create_async_engine(DATABASE_URL, echo=True, future=True) +engine = create_async_engine( + DATABASE_URL, + echo=True, + future=True, + pool_pre_ping=True, + pool_recycle=300, +) async def init_db(): async with engine.begin() as conn: