Commit bceb69e7 by sunqi02

feat(db): add pool_pre_ping for MySQL connection resilience

Reconnects automatically when MySQL server drops idle connections.
No effect on SQLite.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 27c1676f
......@@ -18,6 +18,7 @@ engine = create_engine(
if SQLALCHEMY_DATABASE_URL.startswith("sqlite")
else {}
),
pool_pre_ping=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!