Update next check before processing any result triggering status updates.

Fixes #5733
This commit is contained in:
Michael Friedrich 2014-03-09 18:06:24 +01:00
parent aa2c45f83e
commit 4a077c9ceb
2 changed files with 6 additions and 2 deletions

View File

@ -40,6 +40,7 @@ DbObject::DbObject(const shared_ptr<DbType>& type, const String& name1, const St
void DbObject::StaticInitialize(void)
{
/* triggered in ProcessCheckResult(), requires UpdateNextCheck() to be called before */
DynamicObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
}

View File

@ -405,6 +405,8 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
// "% current: " + Convert::ToString(GetFlappingCurrent()) + "%.");
OnNewCheckResult(GetSelf(), cr, authority);
/* signal status updates to for example db_ido */
OnStateChanged(GetSelf());
if (hardChange)
@ -536,11 +538,12 @@ void Service::ExecuteCheck(void)
result->SetExecutionEnd(after_check);
}
/* update next check before processing any result */
UpdateNextCheck();
if (result)
ProcessCheckResult(result);
UpdateNextCheck();
{
ObjectLock olock(this);
m_CheckRunning = false;