Checkable#next_update: ignore re-scheduled #next_check if !#enable_active_checks

refs #7790
This commit is contained in:
Alexander A. Klimov 2020-01-31 11:49:47 +01:00
parent c37c40d8c6
commit 86bbb79869

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)