diff --git a/app.py b/app.py index e452d1e..0f84e99 100644 --- a/app.py +++ b/app.py @@ -4105,17 +4105,23 @@ def admin_lists_access(list_id=None): ) -@app.route("/healthcheck") +@app.route('/healthcheck') def healthcheck(): - header_token = request.headers.get("X-Internal-Check") - correct_token = app.config.get("HEALTHCHECK_TOKEN") - + header_token = request.headers.get('X-Internal-Check') + correct_token = app.config.get('HEALTHCHECK_TOKEN') if header_token != correct_token: abort(404) - - response_data = { - "status": "OK", - } + + try: + db.session.execute(text('SELECT 1')) + db.session.commit() + response_data = {"status": "ok"} + except Exception as e: + response_data = { + "status": "waiting", + "message": "waiting for db", + "error": str(e) + } return response_data, 200