From 37c2c7ba901144aa18ca64dff0b73d8ea61921f2 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 5 Mar 2020 15:54:17 +0100 Subject: [PATCH] Checkable#Start(): if #last_check_started > last check, set #next_check to #last_check_started refs #7888 --- lib/icinga/checkable.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/icinga/checkable.cpp b/lib/icinga/checkable.cpp index 0f4d1399b..8f21e71f1 100644 --- a/lib/icinga/checkable.cpp +++ b/lib/icinga/checkable.cpp @@ -63,6 +63,14 @@ void Checkable::Start(bool runtimeCreated) { double now = Utility::GetTime(); + { + auto cr (GetLastCheckResult()); + + if (GetLastCheckStarted() > (cr ? cr->GetExecutionEnd() : 0.0)) { + SetNextCheck(GetLastCheckStarted()); + } + } + if (GetNextCheck() < now + 60) { double delta = std::min(GetCheckInterval(), 60.0); delta *= (double)std::rand() / RAND_MAX;