diff --git a/app/database.py b/app/database.py index 57cea68..0586d02 100644 --- a/app/database.py +++ b/app/database.py @@ -33,13 +33,13 @@ if IS_SQLITE: engine = create_async_engine( f"sqlite+aiosqlite:///{sqlite_path}", - echo=settings.DEBUG, + echo=False, ) else: # PostgreSQL 配置 engine = create_async_engine( DB_URL, - echo=settings.DEBUG, + echo=False, poolclass=NullPool, pool_pre_ping=True, ) diff --git a/app/main.py b/app/main.py index 08dc202..6052517 100644 --- a/app/main.py +++ b/app/main.py @@ -208,7 +208,7 @@ async def global_exception_handler(request: Request, exc: Exception) -> JSONResp logger.error("未处理异常: %s", exc, exc_info=True) return JSONResponse( status_code=500, - content={"detail": "服务器内部错误", "message": str(exc) if settings.DEBUG else "请稍后重试"}, + content={"detail": "服务器内部错误", "message": str(exc)}, )