mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-24 10:26:02 +03:00
Add variable for currentTime
Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
This commit is contained in:
parent
8e99cbf426
commit
98ee9caf2c
1 changed files with 3 additions and 2 deletions
|
@ -492,11 +492,12 @@ class Monitor extends BeanModel {
|
|||
let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60;
|
||||
if (timeSinceLastNotified >= this.resendInterval) {
|
||||
// Send notification again, because we are still DOWN
|
||||
log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${R.isoDateTime(dayjs.utc())}`);
|
||||
const currentTime = R.isoDateTime(dayjs.utc());
|
||||
log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${currentTime}`);
|
||||
await Monitor.sendNotification(isFirstBeat, this, bean);
|
||||
|
||||
// Set last notified time to now
|
||||
bean.lastNotifiedTime = R.isoDateTime(dayjs.utc());
|
||||
bean.lastNotifiedTime = currentTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue