Address comments from review

This commit is contained in:
William Calliari 2025-04-16 12:04:53 +02:00
parent abf2fb392b
commit 9d40de78eb
No known key found for this signature in database
GPG Key ID: DBFD45030805358F

View File

@ -344,14 +344,21 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
cr->SetVarsAfter(vars_after);
bool problem_change = false;
if (service) {
SetLastCheckResult(cr);
} else {
bool wasProblem = GetProblem();
SetLastCheckResult(cr);
problem_change = GetProblem() != wasProblem;
if (GetProblem() != wasProblem) {
auto services = host->GetServices();
for (auto& service : services) {
Service::OnHostProblemChanged(service, cr, origin);
}
}
}
bool was_flapping = IsFlapping();
UpdateFlappingStatus(cr->GetState());
@ -501,13 +508,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
if ((stateChange || hardChange) && !children.empty() && (affectsPreviousStateChildren || AffectsChildren()))
OnReachabilityChanged(this, cr, children, origin);
olock->Unlock();
if (!service && problem_change) {
auto services = host->GetServices();
for (auto& service : services) {
Service::OnHostProblemChanged(service, cr, origin);
}
}
olock.Unlock();
if (recovery) {
for (auto& child : children) {