Merge pull request #7804 from Icinga/bugfix/not-overdue-active-checks-disabled-7790

Checkable#next_update: ignore re-scheduled #next_check if !#enable_active_checks
This commit is contained in:
Noah Hilverling 2020-01-31 14:17:30 +01:00 committed by GitHub
commit 572c912c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -192,14 +192,17 @@ bool Checkable::GetHandled() const
Timestamp Checkable::GetNextUpdate() const
{
auto cr (GetLastCheckResult());
double interval, latency;
if (cr) {
return GetNextCheck()
+ (GetProblem() && GetStateType() == StateTypeSoft ? GetRetryInterval() : GetCheckInterval())
+ 2 * (cr->GetExecutionEnd() - cr->GetScheduleStart());
interval = GetProblem() && GetStateType() == StateTypeSoft ? GetRetryInterval() : GetCheckInterval();
latency = cr->GetExecutionEnd() - cr->GetScheduleStart();
} else {
return GetNextCheck() + GetCheckInterval();
interval = GetCheckInterval();
latency = 0.0;
}
return (GetEnableActiveChecks() ? GetNextCheck() : (cr ? cr->GetExecutionEnd() : Application::GetMainTime()) + interval) + interval + 2 * latency;
}
void Checkable::NotifyFixedDowntimeStart(const Downtime::Ptr& downtime)