1
This commit is contained in:
@@ -141,6 +141,11 @@ class ScheduleManager {
|
||||
console.error('[调度管理器] 处理 Boss 消息失败:', error);
|
||||
}
|
||||
});
|
||||
|
||||
// 重连后向 Broker 幂等声明订阅(监听器仅在上方注册一次,不重复添加)
|
||||
if (typeof this.mqttClient.setMaintainedTopics === 'function') {
|
||||
this.mqttClient.setMaintainedTopics(['heartbeat', 'response', 'boss/message']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +157,11 @@ class ScheduleManager {
|
||||
const status = this.mqttDispatcher ? this.mqttDispatcher.getSystemStatus() : {};
|
||||
return {
|
||||
isInitialized: this.isInitialized,
|
||||
mqttConnected: this.mqttClient && this.mqttClient.isConnected,
|
||||
mqttConnected: this.mqttClient && (
|
||||
typeof this.mqttClient.isBrokerConnected === 'function'
|
||||
? this.mqttClient.isBrokerConnected()
|
||||
: this.mqttClient.isConnected
|
||||
),
|
||||
systemStats: deviceManager.getSystemStats(),
|
||||
allDevices: deviceManager.getAllDevicesStatus(),
|
||||
taskQueues: TaskQueue.getAllDeviceStatus(),
|
||||
|
||||
Reference in New Issue
Block a user