Skip to content

Commit

Permalink
Revert "[test] async_session"
Browse files Browse the repository at this point in the history
This reverts commit 773b21d.
  • Loading branch information
mxnoob committed Aug 19, 2024
1 parent 773b21d commit d731609
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/core/db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging

from fastapi import HTTPException
from sqlalchemy import Column, Integer
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import declarative_base, declared_attr, sessionmaker
Expand Down Expand Up @@ -29,4 +30,8 @@ def __repr__(self) -> str:

async def get_async_session():
async with AsyncSessionLocal() as async_session:
yield async_session
try:
yield async_session
except HTTPException as e:
logger.exception("HTTPException %s", e)
raise e

0 comments on commit d731609

Please sign in to comment.