Load bounded recovery predicate only for recovery presentation

This commit is contained in:
martino
2026-10-01 08:38:32 +02:00
parent 3be15211b1
commit 54eef11334
+4 -2
View File
@@ -2070,8 +2070,9 @@ def render_template(event_type: str, data: Dict[str, Any],
return '' return ''
safe_vars = _SafeDict(variables) safe_vars = _SafeDict(variables)
if event_type == 'error_resolved':
from health_recovery import presents_recovery from health_recovery import presents_recovery
if event_type == 'error_resolved' and presents_recovery(data): if presents_recovery(data):
safe_vars['_health_title'] = runtime_message('healthRecovery.title', language, **variables) safe_vars['_health_title'] = runtime_message('healthRecovery.title', language, **variables)
safe_vars['_health_body'] = runtime_message('healthRecovery.body', language, **variables) safe_vars['_health_body'] = runtime_message('healthRecovery.body', language, **variables)
template['title'] = '{_health_title}' template['title'] = '{_health_title}'
@@ -2532,8 +2533,9 @@ def enrich_with_emojis(event_type: str, title: str, body: str,
severity = data.get('severity', 'INFO') severity = data.get('severity', 'INFO')
icon = EVENT_EMOJI.get(event_type) or CATEGORY_EMOJI.get(group) or SEVERITY_ICONS.get(severity, '') icon = EVENT_EMOJI.get(event_type) or CATEGORY_EMOJI.get(group) or SEVERITY_ICONS.get(severity, '')
if event_type == 'error_resolved':
from health_recovery import presents_recovery from health_recovery import presents_recovery
if event_type == 'error_resolved' and presents_recovery(data): if presents_recovery(data):
icon = '✅' icon = '✅'
if event_type == 'backup_complete': if event_type == 'backup_complete':
icon = { icon = {