From efadedaab08c333fe9eb0f0f8ca278dda95b713e Mon Sep 17 00:00:00 2001 From: Jakub Miazek Date: Tue, 17 Jan 2023 20:57:50 +0100 Subject: [PATCH] 69-unnecessary-method --- app/database.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/database.py b/app/database.py index 609a41a..62dd457 100644 --- a/app/database.py +++ b/app/database.py @@ -32,19 +32,3 @@ async def get_db() -> AsyncGenerator: logger.debug(f"ASYNC Pool: {engine.pool.status()}") yield session - -async def get_async_db() -> AsyncGenerator: - try: - session: AsyncSession = AsyncSessionFactory() - logger.debug(f"ASYNC Pool: {engine.pool.status()}") - yield session - except SQLAlchemyError as sql_ex: - await session.rollback() - raise sql_ex - except HTTPException as http_ex: - await session.rollback() - raise http_ex - else: - await session.commit() - finally: - await session.close()