moriire commited on
Commit
e2f7936
1 Parent(s): ab6f064

Update app/db.py

Browse files
Files changed (1) hide show
  1. app/db.py +7 -2
app/db.py CHANGED
@@ -29,8 +29,13 @@ class User(SQLAlchemyBaseUserTableUUID, Base):
29
  pass
30
 
31
 
32
- engine = create_async_engine(DATABASE_URL)
33
- async_session_maker = async_sessionmaker(engine, expire_on_commit=False)
 
 
 
 
 
34
 
35
 
36
  async def create_db_and_tables():
 
29
  pass
30
 
31
 
32
+ engine = create_async_engine(DATABASE_URL, pool_per_ping=True)
33
+ async_session_maker = async_sessionmaker(engine,
34
+ #class_=AsyncSession,
35
+ autoflush=True,
36
+ autocommit=False,
37
+ expire_on_commit=False,
38
+ )
39
 
40
 
41
  async def create_db_and_tables():