more refactoring

This commit is contained in:
Josh Harvey 2016-07-28 18:03:51 +03:00
parent 8acbc90dbd
commit 9a9c927801
6 changed files with 30 additions and 30 deletions

View file

@ -95,18 +95,18 @@ function checkStatus () {
var events = rec.events
devices.forEach(function (deviceRow) {
var deviceFingerprint = deviceRow.fingerprint
var deviceName = deviceRow.name || deviceFingerprint
var deviceId = deviceRow.device_id
var deviceName = deviceRow.name || deviceId
var deviceEvents = events.filter(function (eventRow) {
return eventRow.device_fingerprint === deviceFingerprint
return eventRow.device_id === deviceId
})
var deviceAlerts = []
deviceAlerts = R.concat(deviceAlerts, checkStuckScreen(deviceEvents))
deviceAlerts = R.concat(deviceAlerts, checkPing(deviceEvents))
alerts.devices[deviceFingerprint] = deviceAlerts
alerts.deviceNames[deviceFingerprint] = deviceName
alerts.devices[deviceId] = deviceAlerts
alerts.deviceNames[deviceId] = deviceName
})
return alerts