Checkable#Start(): if #last_check_started > last check, set #next_check to #last_check_started

refs #7888
This commit is contained in:
Alexander A. Klimov 2020-03-05 15:54:17 +01:00
parent 4585a404d6
commit 37c2c7ba90
1 changed files with 8 additions and 0 deletions

View File

@ -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;