From 054269ecf0da4adc61b3bce1618f5531b41181a4 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 20 Jul 2021 11:50:33 +0200 Subject: [PATCH] fix notification when changing from pending -> up --- server/model/monitor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 4545541e..c62fa015 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -120,8 +120,9 @@ class Monitor extends BeanModel { bean.msg = error.message; } - // Mark as important if status changed, ignore pending pings - if ((! previousBeat || previousBeat.status !== bean.status) && bean.status !== 2) { + // Mark as important if status changed, ignore pending pings, + // Don't notify if disrupted changes to up + if ((! previousBeat || previousBeat.status !== bean.status) && bean.status !== 2 && !(previousBeat.status === 2 && bean.status !== 0)) { bean.important = true; // Do not send if first beat is UP