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

View File

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