Skip to content

Commit 8518911

Browse files
ebretontiangolo
authored andcommitted
🗃️ Fix SQLAlchemy operation error after database restarts (fastapi#32)
1 parent 8558ee6 commit 8518911

File tree

1 file changed

+1
-1
lines changed
  • {{cookiecutter.project_slug}}/backend/app/app/db

1 file changed

+1
-1
lines changed

{{cookiecutter.project_slug}}/backend/app/app/db/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from app.core import config
55

6-
engine = create_engine(config.SQLALCHEMY_DATABASE_URI)
6+
engine = create_engine(config.SQLALCHEMY_DATABASE_URI, pool_pre_ping=True)
77
db_session = scoped_session(
88
sessionmaker(autocommit=False, autoflush=False, bind=engine)
99
)

0 commit comments

Comments
 (0)