Merge pull request #7884 from Icinga/bugfix/on-host-problem-changed

Fix OnHostProblemChanged signal
This commit is contained in:
Noah Hilverling 2020-03-04 12:33:44 +01:00 committed by GitHub
commit 27dcb8f221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 15 deletions

View File

@ -248,20 +248,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
SetCheckAttempt(attempt);
ServiceState new_state = cr->GetState();
if (service) {
SetStateRaw(new_state);
} else {
bool wasProblem = GetProblem();
SetStateRaw(new_state);
if (GetProblem() != wasProblem) {
for (auto& service : host->GetServices()) {
Service::OnHostProblemChanged(service, cr, origin);
}
}
}
SetStateRaw(new_state);
bool stateChange;
@ -362,7 +349,20 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
cr->SetVarsAfter(vars_after);
olock.Lock();
SetLastCheckResult(cr);
if (service) {
SetLastCheckResult(cr);
} else {
bool wasProblem = GetProblem();
SetLastCheckResult(cr);
if (GetProblem() != wasProblem) {
for (auto& service : host->GetServices()) {
Service::OnHostProblemChanged(service, cr, origin);
}
}
}
bool was_flapping = IsFlapping();