feat(monitor): add STALE state for push monitors
New intermediate state between LATE and DOWN at the midpoint of the grace period. Gives operators earlier warning that a push monitor has gone quiet. Includes dedicated orange theme color across all 5 themes and proper styling in dashboard, detail panel, and history view.
This commit is contained in:
@@ -509,6 +509,7 @@ func (e *Engine) checkPush(site models.Site) {
|
||||
}
|
||||
|
||||
overdue := site.LastCheck.Add(interval)
|
||||
staleMark := overdue.Add(grace / 2)
|
||||
graceEnd := overdue.Add(grace)
|
||||
now := time.Now()
|
||||
|
||||
@@ -516,6 +517,10 @@ func (e *Engine) checkPush(site models.Site) {
|
||||
if site.Status != "DOWN" {
|
||||
e.handleStatusChange(site, "DOWN", 0, 0, "heartbeat missed")
|
||||
}
|
||||
} else if now.After(staleMark) {
|
||||
if site.Status != "STALE" {
|
||||
e.handleStatusChange(site, "STALE", 0, 0, "heartbeat stale")
|
||||
}
|
||||
} else if now.After(overdue) {
|
||||
if site.Status != "LATE" {
|
||||
e.handleStatusChange(site, "LATE", 0, 0, "heartbeat overdue")
|
||||
|
||||
Reference in New Issue
Block a user