use set_real_state_count

This commit is contained in:
lnk
2025-07-14 13:27:38 +08:00
parent 3fb8ac84f5
commit 8e4e45ce31
4 changed files with 17 additions and 9 deletions

View File

@@ -380,8 +380,8 @@ typedef struct {
// 单条 DataArray 数据
struct DataArrayItem {
int DataAttr;
int DataTimeSec;
int DataTimeUSec;
time_t DataTimeSec;
time_t DataTimeUSec;
int DataTag;
std::string Data;
};

View File

@@ -317,7 +317,7 @@ void Front::FrontThread() {
try {
while (!m_bIsFrontThreadCancle) {
check_3s_config(); // 实时数据触发
//check_3s_config(); // 实时数据触发
//create_recall_xml(); // 生成待补招xml文件
check_ledger_update(); // 触发台账更新
}

View File

@@ -37,6 +37,8 @@
#include "interface.h"
#include "front.h"
#include "../../client2.h"
//////////////////////////////////////////////////////////////////////////////////////////////////////////
using namespace std;
@@ -876,11 +878,13 @@ rocketmq::ConsumeStatus myMessageCallbackrtdata(const rocketmq::MQMessageExt& ms
}
// 写入 XML
if (!createXmlFile(dev_index, mp_index, realData, soeData, limit, "new")) {
/*if (!createXmlFile(dev_index, mp_index, realData, soeData, limit, "new")) {
DIY_ERRORLOG("process", "【ERROR】前置无法创建实时数据触发文件");
std::cerr << "Failed to create the XML file." << std::endl;
return rocketmq::RECONSUME_LATER;
}
}*/
//不再使用文件触发方式,直接调用接口向终端发起请求
ClientManager::instance().set_real_state_count(devid, 60,mp_index);//一秒询问一次询问60次
return rocketmq::CONSUME_SUCCESS;
}
@@ -1009,7 +1013,7 @@ rocketmq::ConsumeStatus myMessageCallbackrecall(const rocketmq::MQMessageExt& ms
if (!result.empty()) {
std::lock_guard<std::mutex> lock(ledgermtx);
recall_json_handle(result);
recall_json_handle(result);//不再使用文件补招方式
} else {
std::cerr << "recall data is NULL." << std::endl;