Skip to content

Commit

Permalink
use sqlalchemy.text for healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsimpson committed Mar 11, 2024
1 parent df8b325 commit a20ca7f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from flask import Flask, render_template
from db import get_db, close_db
import sqlalchemy
from sqlalchemy import text
from logger import log

app = Flask(__name__)
Expand All @@ -18,7 +19,7 @@ def health():
db = get_db()
health = "BAD"
try:
result = db.execute("SELECT NOW()")
result = db.execute(text("SELECT NOW()"))
result = result.one()
health = "OK"
log.info(f"/health reported OK including database connection: {result}")
Expand Down

0 comments on commit a20ca7f

Please sign in to comment.