mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Log: Ensure not to pass negative values to localtime()
refs #6887 (cherry picked from commit 2fc33996b620d97e54d75b0d8c101fb3d9ba791c)
This commit is contained in:
parent
9040c9b512
commit
a557f47e2a
@ -83,10 +83,11 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin)
|
|||||||
adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj);
|
adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj);
|
||||||
|
|
||||||
double nextCheck = now - adj + interval;
|
double nextCheck = now - adj + interval;
|
||||||
|
double lastCheck = GetLastCheck();
|
||||||
|
|
||||||
Log(LogDebug, "Checkable")
|
Log(LogDebug, "Checkable")
|
||||||
<< "Update checkable '" << GetName() << "' with check interval '" << GetCheckInterval()
|
<< "Update checkable '" << GetName() << "' with check interval '" << GetCheckInterval()
|
||||||
<< "' from last check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", GetLastCheck())
|
<< "' from last check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", (lastCheck < 0 ? 0 : lastCheck))
|
||||||
<< " (" << GetLastCheck() << ") to next check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", nextCheck) << "(" << nextCheck << ").";
|
<< " (" << GetLastCheck() << ") to next check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", nextCheck) << "(" << nextCheck << ").";
|
||||||
|
|
||||||
SetNextCheck(nextCheck, false, origin);
|
SetNextCheck(nextCheck, false, origin);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user