Loading app/main.py +10 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,16 @@ def error404(error): "NODE_DIR": app.config["NODE_DIR"], },), 404 #preping is not enough #https://github.com/psycopg/psycopg2/issues/829 @app.before_request def check_connection(): app.logger.info(f"pass into check connection") try: db.session.execute(text("SELECT 1")) except Exception as e: app.logger.error(f"Database connection check failed: {e}") db.session.rollback() # Reset the session app.register_blueprint(blueprint_filter) Loading Loading
app/main.py +10 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,16 @@ def error404(error): "NODE_DIR": app.config["NODE_DIR"], },), 404 #preping is not enough #https://github.com/psycopg/psycopg2/issues/829 @app.before_request def check_connection(): app.logger.info(f"pass into check connection") try: db.session.execute(text("SELECT 1")) except Exception as e: app.logger.error(f"Database connection check failed: {e}") db.session.rollback() # Reset the session app.register_blueprint(blueprint_filter) Loading