chore: server code formatting
This commit is contained in:
parent
aedabcbdee
commit
68517170e2
234 changed files with 9824 additions and 6195 deletions
|
|
@ -12,20 +12,24 @@ const rejectIncompatibleMachines = function (req, res, next) {
|
|||
const machineMajor = semver.major(machineVersion)
|
||||
|
||||
if (serverMajor - machineMajor > 1) {
|
||||
logger.error(`Machine version too old: ${machineVersion} deviceId: ${deviceId}`)
|
||||
logger.error(
|
||||
`Machine version too old: ${machineVersion} deviceId: ${deviceId}`,
|
||||
)
|
||||
return res.status(400).json({
|
||||
error: 'Machine version too old'
|
||||
error: 'Machine version too old',
|
||||
})
|
||||
}
|
||||
|
||||
if (serverMajor < machineMajor) {
|
||||
logger.error(`Machine version too new: ${machineVersion} deviceId: ${deviceId}`)
|
||||
logger.error(
|
||||
`Machine version too new: ${machineVersion} deviceId: ${deviceId}`,
|
||||
)
|
||||
return res.status(400).json({
|
||||
error: 'Machine version too new'
|
||||
error: 'Machine version too new',
|
||||
})
|
||||
}
|
||||
|
||||
next()
|
||||
}
|
||||
|
||||
module.exports = rejectIncompatibleMachines
|
||||
module.exports = rejectIncompatibleMachines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue