do not send notification if first beat is UP

This commit is contained in:
LouisLam 2021-07-10 01:15:21 +08:00
parent 072e86542a
commit ff4259380e
1 changed files with 20 additions and 17 deletions

View File

@ -109,6 +109,8 @@ class Monitor extends BeanModel {
if (! previousBeat || previousBeat.status !== bean.status) {
bean.important = true;
// Do not send if first beat is UP
if (previousBeat || bean.status !== 1) {
let notificationList = await R.getAll(`SELECT notification.* FROM notification, monitor_notification WHERE monitor_id = ? AND monitor_notification.notification_id = notification.id `, [
this.id
])
@ -129,6 +131,7 @@ class Monitor extends BeanModel {
}
await Promise.all(promiseList);
}
} else {
bean.important = false;