mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-02 03:26:31 -04:00
Ssynchronize push monitor heartbeats to api calls
Includes a 1s buffer time to allow the push url to be called before the monitor is checked
This commit is contained in:
parent
d39dc94496
commit
39df4eea92
4 changed files with 54 additions and 48 deletions
|
@ -55,7 +55,7 @@ router.get("/api/push/:pushToken", async (request, response) => {
|
|||
let duration = 0;
|
||||
|
||||
let bean = R.dispense("heartbeat");
|
||||
bean.time = R.isoDateTime(dayjs.utc());
|
||||
bean.time = R.isoDateTimeMillis(dayjs.utc());
|
||||
|
||||
if (previousHeartbeat) {
|
||||
isFirstBeat = false;
|
||||
|
@ -63,8 +63,9 @@ router.get("/api/push/:pushToken", async (request, response) => {
|
|||
duration = dayjs(bean.time).diff(dayjs(previousHeartbeat.time), "second");
|
||||
}
|
||||
|
||||
log.debug("router", "PreviousStatus: " + previousStatus);
|
||||
log.debug("router", "Current Status: " + status);
|
||||
log.debug(`/api/push/ called at ${dayjs().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
||||
log.debug("PreviousStatus: " + previousStatus);
|
||||
log.debug("Current Status: " + status);
|
||||
|
||||
bean.important = Monitor.isImportantBeat(isFirstBeat, previousStatus, status);
|
||||
bean.monitor_id = monitor.id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue