|
@ -3,7 +3,7 @@ from sqlalchemy.orm import scoped_session, sessionmaker |
|
|
|
|
|
|
|
|
from app.core import config |
|
|
from app.core import config |
|
|
|
|
|
|
|
|
engine = create_engine(config.SQLALCHEMY_DATABASE_URI) |
|
|
engine = create_engine(config.SQLALCHEMY_DATABASE_URI, pool_pre_ping=True) |
|
|
db_session = scoped_session( |
|
|
db_session = scoped_session( |
|
|
sessionmaker(autocommit=False, autoflush=False, bind=engine) |
|
|
sessionmaker(autocommit=False, autoflush=False, bind=engine) |
|
|
) |
|
|
) |
|
|