mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-03 12:06:04 -04:00
cache last heartbeat list in memory
This commit is contained in:
parent
0bf0cfa104
commit
87678ea92d
5 changed files with 105 additions and 26 deletions
|
@ -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 = [];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue