fix recall
This commit is contained in:
@@ -4281,8 +4281,25 @@ void check_recall_event() {
|
||||
// 遍历所有 terminal —— 每个 terminal 只挑一条,先不判断运行状态,因为正在处理其他事务的装置也可以记录待补招信息
|
||||
for (auto& dev : terminal_devlist) {
|
||||
//如果该终端不是正在补招或者idle则直接跳过,节省运行时间
|
||||
if(dev.busytype != static_cast<int>(DeviceState::READING_EVENTLOG) && dev.busytype != static_cast<int>(DeviceState::IDLE)){
|
||||
std::cout << "[check_recall_event] skip dev=" << dev.terminal_id << std::endl;
|
||||
bool allow_check =
|
||||
dev.busytype == static_cast<int>(DeviceState::IDLE) ||
|
||||
dev.busytype == static_cast<int>(DeviceState::READING_EVENTLOG);
|
||||
|
||||
// 如果你允许“事件抢占文件”,并且当前没有文件 RUNNING,则也允许评估事件:
|
||||
if (!allow_check && dev.busytype == static_cast<int>(DeviceState::READING_STATSFILE)) {
|
||||
bool has_file_running = false;
|
||||
for (const auto& lm2 : dev.line) {
|
||||
if (!lm2.recall_list_static.empty() &&
|
||||
lm2.recall_list_static.front().recall_status == static_cast<int>(RecallStatus::RUNNING)) {
|
||||
has_file_running = true; break;
|
||||
}
|
||||
}
|
||||
if (!has_file_running) allow_check = true; // 没有文件正在跑,允许事件优先
|
||||
}
|
||||
|
||||
if (!allow_check) {
|
||||
std::cout << "[check_recall_event] skip dev=" << dev.terminal_id
|
||||
<< " busytype=" << dev.busytype << std::endl;
|
||||
continue;
|
||||
}
|
||||
// 对正在补招或idle终端的所有监测点的待补招列表进行处理
|
||||
|
||||
Reference in New Issue
Block a user