changed db engine to mysql
All checks were successful
Deploy FluentGerman.ai / deploy (push) Successful in 50s
All checks were successful
Deploy FluentGerman.ai / deploy (push) Successful in 50s
This commit is contained in:
@@ -19,7 +19,7 @@ class Settings(BaseSettings):
|
||||
algorithm: str = "HS256"
|
||||
|
||||
# Database
|
||||
database_url: str = "postgresql+asyncpg://fluentgerman:fluentgerman@localhost:5432/fluentgerman"
|
||||
database_url: str = "mysql+aiomysql://fluentgerman:fluentgerman@localhost:3306/fluentgerman"
|
||||
|
||||
# LLM
|
||||
llm_provider: str = "openai" # used by litellm routing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""FluentGerman.ai — Database setup (async PostgreSQL)."""
|
||||
"""FluentGerman.ai — Database setup (async MySQL)."""
|
||||
|
||||
from collections.abc import AsyncGenerator
|
||||
|
||||
@@ -7,7 +7,11 @@ from sqlalchemy.orm import DeclarativeBase
|
||||
|
||||
from app.config import get_settings
|
||||
|
||||
engine = create_async_engine(get_settings().database_url, echo=get_settings().debug)
|
||||
engine = create_async_engine(
|
||||
get_settings().database_url,
|
||||
echo=get_settings().debug,
|
||||
pool_recycle=3600, # Reconnect before MySQL's wait_timeout (default 8h)
|
||||
)
|
||||
async_session = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user