main
HuangHai 2 weeks ago
parent fe6fbc5ffd
commit 39e9ad7925

@ -147,7 +147,6 @@ async def get_tree_data():
try:
pg_pool = await init_postgres_pool()
async with pg_pool.acquire() as conn:
await conn.ping()
async with conn.cursor() as cur:
await cur.execute("""
SELECT id,
@ -215,7 +214,6 @@ async def update_knowledge(request: fastapi.Request):
pg_pool = await init_postgres_pool()
async with pg_pool.acquire() as conn:
await conn.ping()
async with conn.cursor() as cur:
if update_type == 'prerequisite':
await cur.execute(

@ -1,15 +1,10 @@
"""
pip install asyncpg
"""
import logging
import asyncpg
from Config.Config import *
# 配置日志
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
logger = logging.getLogger(__name__)
# PostgreSQL 配置
POSTGRES_CONFIG = {
"host": POSTGRES_HOST,

Loading…
Cancel
Save