mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-25 18:48:50 +02:00
parent
31c4ba31b8
commit
e813632ae2
@ -299,28 +299,6 @@ bool TimePeriod::IsInside(double ts) const
|
||||
return false;
|
||||
}
|
||||
|
||||
double TimePeriod::FindNextTransition(double begin)
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
||||
Array::Ptr segments = GetSegments();
|
||||
|
||||
double closestTransition = -1;
|
||||
|
||||
if (segments) {
|
||||
ObjectLock dlock(segments);
|
||||
for (const Dictionary::Ptr& segment : segments) {
|
||||
if (segment->Get("begin") > begin && (segment->Get("begin") < closestTransition || closestTransition == -1))
|
||||
closestTransition = segment->Get("begin");
|
||||
|
||||
if (segment->Get("end") > begin && (segment->Get("end") < closestTransition || closestTransition == -1))
|
||||
closestTransition = segment->Get("end");
|
||||
}
|
||||
}
|
||||
|
||||
return closestTransition;
|
||||
}
|
||||
|
||||
void TimePeriod::UpdateTimerHandler()
|
||||
{
|
||||
double now = Utility::GetTime();
|
||||
|
@ -27,7 +27,6 @@ public:
|
||||
bool GetIsInside() const override;
|
||||
|
||||
bool IsInside(double ts) const;
|
||||
double FindNextTransition(double begin);
|
||||
|
||||
void ValidateRanges(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils) override;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user