fix date bug

This commit is contained in:
Josh Harvey 2016-04-21 18:29:18 +03:00
parent fefeedb086
commit 1a93d6ae02
4 changed files with 17 additions and 4 deletions

View file

@ -35,9 +35,12 @@ function checkPing (deviceEvents) {
var NETWORK_DOWN_TIME = 2 * 60 * 1000
if (!lastEvent) {
return []
return [{code: 'ping'}]
}
console.log('DEBUG6')
console.log(lastEvent)
if (lastEvent.age > NETWORK_DOWN_TIME) {
return [{code: 'ping'}]
}
@ -100,8 +103,11 @@ function checkStatus (cb) {
})
console.log('DEVICE: ' + deviceRow.fingerprint)
alerts = R.concat(alerts, checkStuckScreen(deviceRow, deviceEvents))
alerts = R.concat(alerts, checkPing(deviceRow, deviceEvents))
alerts = R.concat(alerts, checkStuckScreen(deviceEvents))
alerts = R.concat(alerts, checkPing(deviceEvents))
console.log(deviceFingerprint)
console.log(alerts)
// TODO: Use promises to do this right
})