Skip to content

Commit

Permalink
fix: session close logic
Browse files Browse the repository at this point in the history
  • Loading branch information
robcxyz committed Nov 30, 2024
1 parent 49cdfa3 commit aa95e79
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions icon_stats/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ async def get_session(db_name: str = "stats"):
async with session_factories[db_name]() as session:
try:
yield session
except Exception as e:
await session.rollback()
finally:
await session.close()
raise e


# Generic sqlmodel table
Expand Down

0 comments on commit aa95e79

Please sign in to comment.