This commit is contained in:
2025-08-28 15:50:23 +08:00
parent 864cb2a76a
commit aebeaa4a45
2 changed files with 116 additions and 98 deletions

View File

@@ -37,8 +37,8 @@ logger.addHandler(handler)
@asynccontextmanager
async def lifespan(_: FastAPI):
pool = await init_postgres_pool()
app.state.pool = pool
#pool = await init_postgres_pool()
#app.state.pool = pool
asyncio.create_task(train_document_task())
@@ -46,7 +46,7 @@ async def lifespan(_: FastAPI):
yield
finally:
# 应用关闭时销毁连接池
await close_postgres_pool(pool)
#await close_postgres_pool(pool)
pass