refactor: move recordPing() to poll()
This commit is contained in:
parent
af0029581e
commit
40791cb4cd
2 changed files with 5 additions and 5 deletions
|
|
@ -82,11 +82,12 @@ function poll (req, res, next) {
|
|||
state.pids = _.update(operatorId, _.set(deviceId, { pid, ts: Date.now() }), state.pids)
|
||||
|
||||
return Promise.all([
|
||||
pi.pollQueries(deviceTime, req.query, machineVersion, machineModel),
|
||||
pi.recordPing(deviceTime, machineVersion, machineModel),
|
||||
pi.pollQueries(),
|
||||
buildTriggers(configManager.getTriggers(settings.config)),
|
||||
configManager.getTriggersAutomation(settings.config)
|
||||
])
|
||||
.then(([results, triggers, triggersAutomation]) => {
|
||||
.then(([_pingRes, results, triggers, triggersAutomation]) => {
|
||||
const reboot = pid && state.reboots?.[operatorId]?.[deviceId] === pid
|
||||
const shutdown = pid && state.shutdowns?.[operatorId]?.[deviceId] === pid
|
||||
const restartServices = pid && state.restartServicesMap?.[operatorId]?.[deviceId] === pid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue