Compare commits

...

2 Commits

Author SHA1 Message Date
zyc
7aa6781c6d Merge pull request 'fix: auto repair bugs #54' (#2) from fix/auto-20260228-143852 into main
Some checks failed
Build and Deploy Log Center / build-and-deploy (push) Has been cancelled
Merge PR #2 (approved via Log Center)
2026-02-28 14:46:42 +08:00
repair-agent
c94c7bd420 fix: auto repair bugs #54 2026-02-28 14:41:39 +08:00

View File

@ -16,7 +16,13 @@ DB_NAME = os.getenv("DB_NAME")
DATABASE_URL = f"postgresql+asyncpg://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}" DATABASE_URL = f"postgresql+asyncpg://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}"
engine = create_async_engine(DATABASE_URL, echo=True, future=True) engine = create_async_engine(
DATABASE_URL,
echo=True,
future=True,
pool_pre_ping=True,
pool_recycle=300,
)
async def init_db(): async def init_db():
async with engine.begin() as conn: async with engine.begin() as conn: