mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 09:55:47 +08:00
cache last heartbeat list in memory
This commit is contained in:
@@ -33,13 +33,14 @@ async function sendNotificationList(socket) {
|
||||
async function sendHeartbeatList(socket, monitorID, toUser = false, overwrite = false) {
|
||||
const timeLogger = new TimeLogger();
|
||||
|
||||
let list = await R.find("heartbeat", `
|
||||
monitor_id = ?
|
||||
ORDER BY time DESC
|
||||
LIMIT 100
|
||||
`, [
|
||||
monitorID,
|
||||
])
|
||||
let monitor = userMonitorList.getMonitor(socket.userID, monitorID);
|
||||
|
||||
if (! monitor) {
|
||||
console.error("No this monitor??");
|
||||
return;
|
||||
}
|
||||
|
||||
let list = monitor.getCachedHeartbeatList().array;
|
||||
|
||||
let result = [];
|
||||
|
||||
|
Reference in New Issue
Block a user