Merge branch 'feat/test-coverage'
This commit is contained in:
@@ -629,4 +629,21 @@ def create_app() -> Flask:
|
||||
metrics=metrics, total_selection=len(selection),
|
||||
groups=groups)
|
||||
|
||||
# --- Health check endpoint ---
|
||||
@app.route("/health")
|
||||
def health():
|
||||
from datetime import datetime, timezone
|
||||
ollama_ok = False
|
||||
try:
|
||||
r = requests.get(f"{OLLAMA_URL}/api/tags", timeout=2)
|
||||
ollama_ok = r.status_code == 200
|
||||
except Exception:
|
||||
pass
|
||||
return jsonify({
|
||||
"status": "ok",
|
||||
"version": "2.1.0",
|
||||
"ollama": ollama_ok,
|
||||
"timestamp": datetime.now(timezone.utc).isoformat(),
|
||||
})
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user