Skip to content

Commit

Permalink
Execute initial checks immediately
Browse files Browse the repository at this point in the history
refs #5083
  • Loading branch information
Tobias von der Krone committed Mar 23, 2017
1 parent f169232 commit 687153b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/icinga/checkable-check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin)
{
double interval;

if (GetStateType() == StateTypeSoft && GetLastCheckResult() != NULL)
if (GetStateType() == StateTypeSoft && HasBeenChecked())
interval = GetRetryInterval();
else
interval = GetCheckInterval();
Expand All @@ -80,7 +80,10 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin)

adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj);

SetNextCheck(now - adj + interval, false, origin);
if (HasBeenChecked())
SetNextCheck(now - adj + interval, false, origin);
else
SetNextCheck(now, false, origin);
}

bool Checkable::HasBeenChecked(void) const
Expand Down

0 comments on commit 687153b

Please sign in to comment.