Commit 3a55b02e authored by Anthony Jacob's avatar Anthony Jacob
Browse files

pre ping db to avoid 500 error when connection lost

parent 00882499
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,10 @@ app.config['SQLALCHEMY_DATABASE_URI'] = f"postgresql://{app.config['POSTGRES_USE
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)
app.config['PROPAGATE_EXCEPTIONS'] = True
app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {
    "pool_pre_ping": True,
    "pool_recycle": 1800,
}

babel = Babel(app)