1
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const db = require('../dbProxy.js');
|
const db = require('../dbProxy.js');
|
||||||
|
const logProxy = require('../logProxy.js');
|
||||||
const deviceManager = require('../schedule/deviceManager.js');
|
const deviceManager = require('../schedule/deviceManager.js');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -268,6 +269,11 @@ class MqttDispatcher {
|
|||||||
await device_status.update(updateData, { where: { sn_code } });
|
await device_status.update(updateData, { where: { sn_code } });
|
||||||
console.log(`[MQTT心跳] 设备 ${sn_code} 状态已更新 - 在线: true, 登录: ${updateData.isLoggedIn}`);
|
console.log(`[MQTT心跳] 设备 ${sn_code} 状态已更新 - 在线: true, 登录: ${updateData.isLoggedIn}`);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logProxy.error('[MQTT心跳] 设备 ${sn_code} 不存在', { sn_code });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 记录心跳到设备管理器
|
// 记录心跳到设备管理器
|
||||||
await deviceManager.recordHeartbeat(sn_code, heartbeatData);
|
await deviceManager.recordHeartbeat(sn_code, heartbeatData);
|
||||||
|
|||||||
Reference in New Issue
Block a user