移除前端对频率的限制(非服务端部署代码,服务端需要对应修改)
This commit is contained in:
@@ -352,15 +352,15 @@
|
|||||||
result_type: msg.result_type
|
result_type: msg.result_type
|
||||||
};
|
};
|
||||||
|
|
||||||
const now = msg.timestamp;
|
// const now = msg.timestamp;
|
||||||
const timeThreshold = now - 10;
|
// const timeThreshold = now - 10;
|
||||||
|
|
||||||
const existingAlert = alerts.find(alert =>
|
// const existingAlert = alerts.find(alert =>
|
||||||
JSON.stringify(alert.result_type) === JSON.stringify(alertMsg.result_type) &&
|
// JSON.stringify(alert.result_type) === JSON.stringify(alertMsg.result_type) &&
|
||||||
alert.timestamp > timeThreshold
|
// alert.timestamp > timeThreshold
|
||||||
);
|
// );
|
||||||
|
|
||||||
if (!existingAlert) {
|
// if (!existingAlert) {
|
||||||
alerts.push(alertMsg);
|
alerts.push(alertMsg);
|
||||||
// console.log('添加新的异常告警:', alertMsg);
|
// console.log('添加新的异常告警:', alertMsg);
|
||||||
// console.log('当前alerts数组长度:', alerts.length);
|
// console.log('当前alerts数组长度:', alerts.length);
|
||||||
@@ -370,7 +370,7 @@
|
|||||||
|
|
||||||
const alertTypes = alertMsg.result_type.join(', ');
|
const alertTypes = alertMsg.result_type.join(', ');
|
||||||
addLog(`检测到异常: ${alertTypes}`, 'warning');
|
addLog(`检测到异常: ${alertTypes}`, 'warning');
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
} else if (msg.msg_type === 'take_out') {
|
} else if (msg.msg_type === 'take_out') {
|
||||||
// console.log('处理take_out类型消息');
|
// console.log('处理take_out类型消息');
|
||||||
|
|||||||
Reference in New Issue
Block a user