mirror of https://github.com/Icinga/icinga2.git
Make sure that TimePeriod segments are being merged properly.
Refs #5268
This commit is contained in:
parent
fa14b39719
commit
e2941dbca8
|
@ -70,12 +70,12 @@ void TimePeriod::AddSegment(double begin, double end)
|
||||||
if (segment->Get("begin") <= begin && segment->Get("end") >= end)
|
if (segment->Get("begin") <= begin && segment->Get("end") >= end)
|
||||||
return; /* New segment is fully contained in this segment. */
|
return; /* New segment is fully contained in this segment. */
|
||||||
|
|
||||||
if (segment->Get("begin") < begin && segment->Get("end") > begin) {
|
if (segment->Get("begin") <= begin && segment->Get("end") >= begin) {
|
||||||
segment->Set("end", end); /* Extend an existing segment. */
|
segment->Set("end", end); /* Extend an existing segment. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (segment->Get("begin") > begin && segment->Get("begin") < end) {
|
if (segment->Get("begin") >= begin && segment->Get("begin") <= end) {
|
||||||
segment->Set("begin", begin); /* Extend an existing segment. */
|
segment->Set("begin", begin); /* Extend an existing segment. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue