mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
sendHeartbeatList use raw data
This commit is contained in:
parent
9f9c1007d7
commit
24facc79d7
1 changed files with 4 additions and 7 deletions
|
@ -32,19 +32,16 @@ async function sendNotificationList(socket) {
|
||||||
async function sendHeartbeatList(socket, monitorID, toUser = false, overwrite = false) {
|
async function sendHeartbeatList(socket, monitorID, toUser = false, overwrite = false) {
|
||||||
const timeLogger = new TimeLogger();
|
const timeLogger = new TimeLogger();
|
||||||
|
|
||||||
let list = await R.find("heartbeat", `
|
let list = await R.getAll(`
|
||||||
monitor_id = ?
|
SELECT * FROM heartbeat
|
||||||
|
WHERE monitor_id = ?
|
||||||
ORDER BY time DESC
|
ORDER BY time DESC
|
||||||
LIMIT 100
|
LIMIT 100
|
||||||
`, [
|
`, [
|
||||||
monitorID,
|
monitorID,
|
||||||
])
|
])
|
||||||
|
|
||||||
let result = [];
|
let result = list.reverse();
|
||||||
|
|
||||||
for (let bean of list) {
|
|
||||||
result.unshift(bean.toJSON());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toUser) {
|
if (toUser) {
|
||||||
io.to(socket.userID).emit("heartbeatList", monitorID, result, overwrite);
|
io.to(socket.userID).emit("heartbeatList", monitorID, result, overwrite);
|
||||||
|
|
Loading…
Reference in a new issue