feat: 加点日志,timeout 时强制中止 hProcess

This commit is contained in:
zzyyyl
2022-09-27 19:10:25 +08:00
parent 1cc7e66189
commit 14ed0ca367

View File

@@ -286,6 +286,25 @@ std::optional<std::string> asst::Controller::call_command(const std::string& cmd
}
else if (wait_result == WAIT_TIMEOUT) {
if (wait_time == 0) {
std::vector<std::string> handle_string {};
for (auto handle : wait_handles) {
if (handle == process_info.hProcess) {
handle_string.emplace_back("process_info.hProcess");
}
else if (handle == pipeov.hEvent) {
handle_string.emplace_back("pipeov.hEvent");
}
else if (recv_by_socket && handle == sockov.hEvent) {
handle_string.emplace_back("sockov.hEvent");
}
else {
handle_string.emplace_back("UnknownHandle");
}
}
Log.warn("Wait handles:", handle_string, "timeout.");
if (process_running) {
TerminateProcess(process_info.hProcess, 0);
}
break;
}
continue;