Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions backend/app/tasks/monitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
"major_outage": 6,
}

def _worst(s1, s2):
"""Return whichever of the two status strings has higher severity."""
if s1 is None:
return s2
if s2 is None:
return s1
return s1 if _STATUS_PRIORITY.get(s1, 0) >= _STATUS_PRIORITY.get(s2, 0) else s2


def _compute_service_status(service, source_monitor=None, source_status=None):
"""Compute the rolled-up service status across all active monitors.
Expand Down
Loading