From 25262cfb91d46b1ff398e05bdd9ec613f07881c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Kr=C3=BDda?= <59953812+karelkryda@users.noreply.github.com> Date: Mon, 30 May 2022 15:31:45 +0200 Subject: [PATCH] Update server/model/monitor.js Co-authored-by: Matthew Nickson --- server/model/monitor.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/model/monitor.js b/server/model/monitor.js index cce9060d..4f483415 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -796,6 +796,13 @@ class Monitor extends BeanModel { (previousBeatStatus === PENDING && currentBeatStatus === DOWN); } + /** + * Is this beat important for notifications? + * @param {boolean} isFirstBeat Is this the first beat of this monitor? + * @param {const} previousBeatStatus Status of the previous beat + * @param {const} currentBeatStatus Status of the current beat + * @returns {boolean} True if is an important beat else false + */ static isImportantForNotification(isFirstBeat, previousBeatStatus, currentBeatStatus) { // * ? -> ANY STATUS = important [isFirstBeat] // UP -> PENDING = not important