87f2845483
- Cleaned up whitespace and formatting in various files including http.py, language.py, logger.py, safe_exec.py, and SQL migration scripts. - Consolidated import statements and removed unnecessary blank lines. - Updated logging configuration for better clarity. - Enhanced the safe execution code with improved error handling and logging. - Removed commented-out code and unnecessary variables in backfill_zero_trades.py and other scripts. - Added a pyproject.toml for Ruff and Vulture configuration. - Introduced requirements-dev.txt for development dependencies. - Removed commented-out stock entries in init.sql for cleaner migration scripts.
35 lines
805 B
Python
35 lines
805 B
Python
"""
|
|
Health check routing
|
|
"""
|
|
|
|
from datetime import datetime
|
|
|
|
from flask import Blueprint, jsonify
|
|
|
|
health_bp = Blueprint("health", __name__)
|
|
|
|
|
|
@health_bp.route("/", methods=["GET"])
|
|
def index():
|
|
"""API Home Page"""
|
|
return jsonify(
|
|
{
|
|
"name": "QuantDinger Python API",
|
|
"version": "2.0.0",
|
|
"status": "running",
|
|
"timestamp": datetime.now().isoformat(),
|
|
}
|
|
)
|
|
|
|
|
|
@health_bp.route("/health", methods=["GET"])
|
|
def health_check():
|
|
"""health check"""
|
|
return jsonify({"status": "healthy", "timestamp": datetime.now().isoformat()})
|
|
|
|
|
|
@health_bp.route("/api/health", methods=["GET"])
|
|
def api_health_check():
|
|
"""Compatible path: used for container health check/anti-generation probe and other scenarios."""
|
|
return health_check()
|