fix: discord notification timestamp & update notification message (#6894)

This commit is contained in:
Ryan Gurnick
2026-02-13 02:38:50 +00:00
committed by GitHub
parent 5561842dea
commit f2048261b2
3 changed files with 11 additions and 2 deletions
+3 -1
View File
@@ -1520,8 +1520,10 @@ class Monitor extends BeanModel {
// This makes downtime information available to all notification providers
if (bean.status === UP && monitor.id) {
try {
// Filter by important = 1 to get the state transition heartbeat (e.g. UP→DOWN),
// not the most recent DOWN heartbeat which would be the last check before recovery.
const lastDownHeartbeat = await R.getRow(
"SELECT time FROM heartbeat WHERE monitor_id = ? AND status = ? ORDER BY time DESC LIMIT 1",
"SELECT time FROM heartbeat WHERE monitor_id = ? AND status = ? AND important = 1 ORDER BY time DESC LIMIT 1",
[monitor.id, DOWN]
);