Fix System Health.
This commit is contained in:
@@ -456,6 +456,13 @@ def system_admin_health():
|
||||
func.date(SystemEvent.timestamp) == today
|
||||
).count()
|
||||
|
||||
# Calculate 24-hour error count
|
||||
yesterday = now - timedelta(days=1)
|
||||
error_count_24h = SystemEvent.query.filter(
|
||||
SystemEvent.timestamp >= yesterday,
|
||||
SystemEvent.severity == 'error'
|
||||
).count()
|
||||
|
||||
# Log the health check
|
||||
SystemEvent.log_event(
|
||||
'system_health_check',
|
||||
@@ -476,7 +483,8 @@ def system_admin_health():
|
||||
db_healthy=db_healthy,
|
||||
db_error=db_error,
|
||||
uptime_duration=uptime_duration,
|
||||
today_events=today_events)
|
||||
today_events=today_events,
|
||||
error_count_24h=error_count_24h)
|
||||
|
||||
|
||||
@system_admin_bp.route('/branding', methods=['GET', 'POST'])
|
||||
|
||||
Reference in New Issue
Block a user