feat: Task 19 — Health-Check Blueprint mit Readiness-Endpunkt (closes #19)
This commit is contained in:
+9
-5
@@ -8,6 +8,10 @@ from src.config import settings
|
||||
from src.error_handler import register_error_handlers
|
||||
from src.logging_config import setup_logging
|
||||
from src.queue.handler import QueueHandler
|
||||
from src.routes.admin import admin_bp
|
||||
from src.routes.health import health_bp
|
||||
from src.routes.telegram import telegram_bp
|
||||
from src.routes.whatsapp import whatsapp_bp
|
||||
|
||||
|
||||
def create_app() -> Flask:
|
||||
@@ -29,9 +33,9 @@ def create_app() -> Flask:
|
||||
redis_port=settings.REDIS_PORT,
|
||||
)
|
||||
|
||||
@app.route("/health")
|
||||
def health() -> dict:
|
||||
"""Health-Check Endpoint für Monitoring."""
|
||||
return {"status": "ok", "queue_size": app.queue_handler.queue_size()}
|
||||
app.register_blueprint(telegram_bp, url_prefix="/webhook")
|
||||
app.register_blueprint(whatsapp_bp, url_prefix="/webhook")
|
||||
app.register_blueprint(admin_bp, url_prefix="/admin")
|
||||
app.register_blueprint(health_bp)
|
||||
|
||||
return app
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user