mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
compose refactor
This commit is contained in:
@@ -36,6 +36,9 @@ async def lifespan(app: FastAPI):
|
||||
"Postgres pool created", idle_size=app.postgres_pool.get_idle_size()
|
||||
)
|
||||
yield
|
||||
except Exception as e:
|
||||
await logger.aerror("Error during app startup", error=repr(e))
|
||||
raise
|
||||
finally:
|
||||
await app.redis.close()
|
||||
await app.postgres_pool.close()
|
||||
|
||||
Reference in New Issue
Block a user