Störungsmeldungen enthalten jetzt Zeitstempel für eindeutige Benachrichtigungen
This commit is contained in:
@ -16,8 +16,8 @@ def is_debug_mode():
|
||||
|
||||
def get_ti_api_url():
|
||||
"""Gibt die API-URL zurück, im Debug-Modus ggf. die lokale Test-API"""
|
||||
if is_debug_mode():
|
||||
return os.getenv("TI_API_URL_DEBUG", "http://localhost:8000/lageapi/v2/tilage")
|
||||
# if is_debug_mode():
|
||||
# return os.getenv("TI_API_URL_DEBUG", "http://localhost:8000/lageapi/v2/tilage")
|
||||
return os.getenv("TI_API_URL", "https://ti-lage.prod.ccs.gematik.solutions/lageapi/v2/tilage")
|
||||
|
||||
TI_API_URL = get_ti_api_url()
|
||||
@ -152,8 +152,9 @@ def fetch_status_messages():
|
||||
has_maintenance = status.get("hasMaintenance", False)
|
||||
sub_maintenance = status.get("hasSubComponentMaintenance", False)
|
||||
affected = status.get("affectedFunctions", [])
|
||||
# Baue eine verständliche Meldung
|
||||
msg = f"Störung bei {dienst.upper()} ({'Wartung' if has_maintenance else 'Störung'}): Status: {outage}"
|
||||
# Baue eine verständliche Meldung mit Zeitstempel
|
||||
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
msg = f"[{timestamp}] Störung bei {dienst.upper()} ({'Wartung' if has_maintenance else 'Störung'}): Status: {outage}"
|
||||
if affected:
|
||||
for func in affected:
|
||||
func_name = func.get("function", "Unbekannte Funktion")
|
||||
|
||||
Reference in New Issue
Block a user