Event handlers should be run when services are in a soft state.

Fixes #5681
This commit is contained in:
Gunnar Beutner 2014-02-20 10:32:11 +01:00
parent d3cdbb5156
commit 9bdf2f4766
1 changed files with 1 additions and 4 deletions

View File

@ -307,7 +307,6 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
SetState(cr->GetState()); SetState(cr->GetState());
bool call_eventhandler = false;
bool stateChange = (old_state != GetState()); bool stateChange = (old_state != GetState());
if (stateChange) { if (stateChange) {
SetLastStateChange(now); SetLastStateChange(now);
@ -333,8 +332,6 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
service->SetNextCheck(Utility::GetTime()); service->SetNextCheck(Utility::GetTime());
} }
} }
call_eventhandler = true;
} }
bool remove_acknowledgement_comments = false; bool remove_acknowledgement_comments = false;
@ -412,7 +409,7 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
else if (stateChange) else if (stateChange)
OnStateChange(GetSelf(), cr, StateTypeSoft, authority); OnStateChange(GetSelf(), cr, StateTypeSoft, authority);
if (call_eventhandler) if (GetStateType() == StateTypeSoft || hardChange || recovery)
ExecuteEventHandler(); ExecuteEventHandler();
if (send_downtime_notification) if (send_downtime_notification)