feat: ping time internet quality measurement
This commit is contained in:
parent
4f9dc81693
commit
01412e1abe
1 changed files with 8 additions and 8 deletions
|
|
@ -51,16 +51,16 @@ const getStatus = (ping, stuck) => {
|
||||||
function addName (pings, events, config) {
|
function addName (pings, events, config) {
|
||||||
return machine => {
|
return machine => {
|
||||||
const cashOutConfig = configManager.getCashOut(machine.deviceId, config)
|
const cashOutConfig = configManager.getCashOut(machine.deviceId, config)
|
||||||
|
|
||||||
const cashOut = !!cashOutConfig.active
|
const cashOut = !!cashOutConfig.active
|
||||||
|
|
||||||
const statuses = [
|
const statuses = [
|
||||||
getStatus(
|
getStatus(
|
||||||
_.first(pings[machine.deviceId]),
|
_.first(pings[machine.deviceId]),
|
||||||
_.first(checkStuckScreen(events, machine.name))
|
_.first(checkStuckScreen(events, machine.name))
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
return _.assign(machine, { cashOut, statuses })
|
return _.assign(machine, { cashOut, statuses })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -132,9 +132,9 @@ function getMachine (machineId, config) {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return Promise.all([queryMachine, dbm.machineEvents(), config])
|
return Promise.all([queryMachine, dbm.machineEvents(), config])
|
||||||
.then(([machine, events, config]) => {
|
.then(([machine, events, config]) => {
|
||||||
const pings = checkPings([machine])
|
const pings = checkPings([machine])
|
||||||
|
|
||||||
return [machine].map(addName(pings, events, config))[0]
|
return [machine].map(addName(pings, events, config))[0]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue