From e078028f1a8da34f3cc2cb5095b8e103a996f553 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期五, 11 四月 2025 10:16:42 +0800 Subject: [PATCH] 首页智能体中心过滤掉自研类型 --- app/models/postgresql_base_model.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/postgresql_base_model.py b/app/models/postgresql_base_model.py index f139db8..f6caf45 100644 --- a/app/models/postgresql_base_model.py +++ b/app/models/postgresql_base_model.py @@ -7,11 +7,15 @@ DATABASE_URL = os.getenv('POSTGRESQL_DATABASE_URL') or settings.postgresql_database_url -engine = create_async_engine(DATABASE_URL, echo=True) +engine = create_async_engine(DATABASE_URL, echo=False) PostgresqlSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine, class_=AsyncSession) PostgresqlBase = declarative_base() async def get_pdb() -> AsyncSession: async with PostgresqlSessionLocal() as session: - yield session \ No newline at end of file + # yield session + try: + yield session + finally: + session.close() \ No newline at end of file -- Gitblit v1.8.0