feat: ping time internet quality measurement
This commit is contained in:
parent
f2f146265e
commit
515d02dd21
7 changed files with 162 additions and 17 deletions
|
|
@ -14,6 +14,7 @@ const dbErrorCodes = require('./db-error-codes')
|
|||
const options = require('./options')
|
||||
const logger = require('./logger')
|
||||
const configManager = require('./new-config-manager')
|
||||
const machineLoader = require('./machine-loader')
|
||||
const complianceTriggers = require('./compliance-triggers')
|
||||
const pairing = require('./pairing')
|
||||
const newSettingsLoader = require('./new-settings-loader')
|
||||
|
|
@ -243,6 +244,18 @@ function verifyPromoCode (req, res, next) {
|
|||
.catch(next)
|
||||
}
|
||||
|
||||
function networkHeartbeat (req, res, next) {
|
||||
return machineLoader.updateNetworkHeartbeat(req.deviceId, req.body)
|
||||
.then(() => res.status(200).send({ status: 'OK' }))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
function networkPerformance (req, res, next) {
|
||||
return machineLoader.updateNetworkPerformance(req.deviceId, req.body)
|
||||
.then(() => res.status(200).send({ status: 'OK' }))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
function addOrUpdateCustomer (req) {
|
||||
const customerData = req.body
|
||||
const machineVersion = req.query.version
|
||||
|
|
@ -516,6 +529,9 @@ app.get('/poll', poll)
|
|||
app.get('/terms_conditions', getTermsConditions)
|
||||
app.post('/state', stateChange)
|
||||
|
||||
app.post('/network/heartbeat', networkHeartbeat)
|
||||
app.post('/network/performance', networkPerformance)
|
||||
|
||||
app.post('/verify_user', verifyUser)
|
||||
app.post('/verify_transaction', verifyTx)
|
||||
app.post('/verify_promo_code', verifyPromoCode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue