mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2026-06-19 05:12:38 +02:00
feat: check db connection on health endpoint
This commit is contained in:
+5
-1
@@ -429,7 +429,11 @@ def save_in_dispatch_queue(persons, title, message, method, link=""):
|
|||||||
@app.route("/health")
|
@app.route("/health")
|
||||||
def health():
|
def health():
|
||||||
|
|
||||||
return ("Not Iplemented, but at least it's running", 200)
|
try:
|
||||||
|
db.session.execute(text("SELECT 1"))
|
||||||
|
return ({"status": "ok"}, 200)
|
||||||
|
except Exception as e:
|
||||||
|
return ({"status": "error", "message": str(e)}, 500)
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user