mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2026-07-28 05:00:38 +03:00
bump deps
This commit is contained in:
+8
-8
@@ -30,14 +30,14 @@ async def lifespan(app: FastAPI):
|
||||
app.redis = await get_redis()
|
||||
postgres_dsn = global_settings.postgres_url.unicode_string()
|
||||
try:
|
||||
# app.postgres_pool = await asyncpg.create_pool(
|
||||
# dsn=postgres_dsn,
|
||||
# min_size=5,
|
||||
# max_size=20,
|
||||
# )
|
||||
# await app.logger.ainfo(
|
||||
# "Postgres pool created", idle_size=app.postgres_pool.get_idle_size()
|
||||
# )
|
||||
app.postgres_pool = await asyncpg.create_pool(
|
||||
dsn=postgres_dsn,
|
||||
min_size=5,
|
||||
max_size=20,
|
||||
)
|
||||
await app.logger.ainfo(
|
||||
"Postgres pool created", idle_size=app.postgres_pool.get_idle_size()
|
||||
)
|
||||
yield
|
||||
except Exception as e:
|
||||
await app.logger.aerror("Error during app startup", error=repr(e))
|
||||
|
||||
Reference in New Issue
Block a user