mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-01 19:32:34 +02:00
Cleaning up the code
This commit is contained in:
parent
01f530b733
commit
d694dc446c
1 changed files with 2 additions and 3 deletions
|
@ -144,11 +144,10 @@ class Monitor extends BeanModel {
|
||||||
this.id
|
this.id
|
||||||
]);
|
]);
|
||||||
query = query.map(val => val.status);
|
query = query.map(val => val.status);
|
||||||
|
// All the heartbeats are failed except the oldest one
|
||||||
|
// Current beat is failed too
|
||||||
repeatedFailures = bean.status !== 1 && bean.status === query[0] && query.slice(0,-1).every( val => val === query[0] ) && [...query].reverse()[0] !== [...query].reverse()[1];
|
repeatedFailures = bean.status !== 1 && bean.status === query[0] && query.slice(0,-1).every( val => val === query[0] ) && [...query].reverse()[0] !== [...query].reverse()[1];
|
||||||
console.log(query);
|
|
||||||
}
|
}
|
||||||
//0 t 2
|
|
||||||
console.log(bean.status, repeatedFailures, notificationConfig.failThreshold)
|
|
||||||
if((bean.status === 1 && !repeatedFailures) ||
|
if((bean.status === 1 && !repeatedFailures) ||
|
||||||
(notificationConfig.failThreshold <= 1 && !repeatedFailures) ||
|
(notificationConfig.failThreshold <= 1 && !repeatedFailures) ||
|
||||||
(notificationConfig.failThreshold > 1 && repeatedFailures)) promiseList.push(Notification.send(notificationConfig, msg, await this.toJSON(), bean.toJSON()));
|
(notificationConfig.failThreshold > 1 && repeatedFailures)) promiseList.push(Notification.send(notificationConfig, msg, await this.toJSON(), bean.toJSON()));
|
||||||
|
|
Loading…
Add table
Reference in a new issue