feat: Phase 3 Tasks 16-18 — Pydantic-Settings, Error-Handler, systemd
This commit is contained in:
+8
-8
@@ -1,7 +1,11 @@
|
||||
"""Flask App-Factory – Einstiegspunkt des BSN-Livesystems."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from flask import Flask
|
||||
|
||||
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
|
||||
|
||||
@@ -18,15 +22,11 @@ def create_app() -> Flask:
|
||||
app = Flask(__name__)
|
||||
|
||||
setup_logging()
|
||||
|
||||
app.config.from_mapping(
|
||||
REDIS_HOST="localhost",
|
||||
REDIS_PORT=6379,
|
||||
)
|
||||
register_error_handlers(app)
|
||||
|
||||
app.queue_handler = QueueHandler(
|
||||
redis_host=app.config["REDIS_HOST"],
|
||||
redis_port=app.config["REDIS_PORT"],
|
||||
redis_host=settings.REDIS_HOST,
|
||||
redis_port=settings.REDIS_PORT,
|
||||
)
|
||||
|
||||
@app.route("/health")
|
||||
@@ -34,4 +34,4 @@ def create_app() -> Flask:
|
||||
"""Health-Check Endpoint für Monitoring."""
|
||||
return {"status": "ok", "queue_size": app.queue_handler.queue_size()}
|
||||
|
||||
return app
|
||||
return app
|
||||
Reference in New Issue
Block a user