data: No longer closes all intervals after subtracting ranges

This commit is contained in:
Paul Beckingham 2016-05-30 09:54:36 -04:00
parent d995ff57b7
commit 2c5dd1dec0

View file

@ -401,10 +401,18 @@ std::vector <Interval> flatten (
// Only historical data is included. // Only historical data is included.
if (chunk.range.start <= now) if (chunk.range.start <= now)
{ {
// A future range.end should be truncated. // Closed chunk ranges in the future need to be adjusted.
if (! chunk.range.is_open () && if (! chunk.range.is_open () &&
chunk.range.end >= now) chunk.range.end > now)
{
// If the interval is open, so must be chunk.
if (interval.range.is_open ())
chunk.range.end = {0};
// Otherwise truncate to now.
else
chunk.range.end = now; chunk.range.end = now;
}
all.push_back (chunk); all.push_back (chunk);
} }