check if detector already set up
Build on RHEL9 docker image / build (push) Successful in 4m38s
Build on RHEL8 docker image / build (push) Successful in 5m45s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m39s
Run Simulator Tests on local RHEL8 / build (push) Successful in 22m9s

This commit is contained in:
2026-07-08 09:42:42 +02:00
parent cfccb1d749
commit 447e83dac3
3 changed files with 21 additions and 7 deletions
@@ -481,14 +481,19 @@ ProcessedResult DetectorServer<DerivedDetectorServer>::initial_checks(
ServerInterface &socket) const {
auto detectorsetupstatus = getDerivedImpl()->initial_checks();
const bool setup_successful = detectorsetupstatus.successful_setup;
if (!setup_successful) {
// TODO: should there be a time limit?
while (detectorsetupstatus.setup_status ==
detector_setup_status::NOT_SETUP) {
std::this_thread::sleep_for(std::chrono::seconds(1));
detectorsetupstatus = getDerivedImpl()->initial_checks();
}
if (detectorsetupstatus.setup_status ==
detector_setup_status::FAILED_SETUP) {
return return_fail("Initial checks failed: " +
detectorsetupstatus.error_message);
} else {
return ProcessedResult{
static_cast<ReturnCode>(socket.sendResult(setup_successful))};
static_cast<ReturnCode>(socket.sendResult(true))};
}
}
@@ -18,8 +18,15 @@ struct UDPInfo {
/// @brief struct to store detector setup status
struct detector_setup_status {
enum SETUP_STATUS : uint8_t {
FAILED_SETUP = 0,
SUCCESSFUL_SETUP = 1,
NOT_SETUP = 2
};
/// @brief true if setupDetector() was successful, false otherwise
bool successful_setup{false};
SETUP_STATUS setup_status{NOT_SETUP};
/// @brief error message if setupDetector() failed, empty otherwise
std::string error_message{};
};