feat: machine performance indicators

This commit is contained in:
José Oliveira 2021-07-16 03:22:47 +01:00 committed by Josh Harvey
parent 9896b44178
commit 1a166bc279
9 changed files with 189 additions and 23 deletions

View file

@ -289,6 +289,23 @@ function plugins (settings, deviceId) {
])
}
function pruneMachinesHeartbeat () {
const sql = `DELETE
FROM
machine_network_heartbeat h
USING (SELECT
device_id,
max(created) as lastEntry
FROM
machine_network_heartbeat
GROUP BY
device_id) d
WHERE
d.device_id = h.device_id
AND h.created < d.lastEntry`
db.none(sql)
}
function isHd (tx) {
return wallet.isHd(settings, tx)
}
@ -795,7 +812,8 @@ function plugins (settings, deviceId) {
sell,
getNotificationConfig,
notifyOperator,
fetchCurrentConfigVersion
fetchCurrentConfigVersion,
pruneMachinesHeartbeat
}
}