def health_check(): with app.db.session_scope() as session: try: session.execute('SELECT 1') except Exception: raise UnhealthyCheck('Unhealthy') return 'Healthy', 200
def health_check(): with app.db.session_scope() as session: try: session.execute("SELECT 1") except Exception: raise UnhealthyCheck("Unhealthy") return "Healthy", 200
def health_check(): """ Health check endpoint --- tags: - system responses: 200: description: Healthy default: description: Unhealthy """ with app.db.session_scope() as session: try: session.execute("SELECT 1") except Exception: raise UnhealthyCheck("Unhealthy") return "Healthy", 200
def health_check(): """ Health check endpoint --- tags: - system responses: 200: description: Healthy default: description: Unhealthy """ with app.db.session_scope() as session: try: session.connection(execution_options={"isolation_level": "READ COMMITTED"}) session.execute("SELECT 1") except Exception: raise UnhealthyCheck("Unhealthy") return "Healthy", 200