Skip to content

Commit d5cd0bc

Browse files
committedFeb 2, 2017
Fix to keep exhaustive agg from going on into forever
1 parent 4177388 commit d5cd0bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/main/java/org/kairosdb/core/aggregator/RangeAggregator.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,14 @@ public void setStartTime(long startTime)
164164

165165
public void setEndTime(long endTime)
166166
{
167-
m_queryEndTime = endTime;
167+
//This is to tell the exhaustive agg when to stop.
168+
//If the end time is not specified in the query the end time is
169+
//set to MAX_LONG which causes exhaustive agg to go on forever.
170+
long now = System.currentTimeMillis();
171+
if (endTime > now)
172+
m_queryEndTime = now;
173+
else
174+
m_queryEndTime = endTime;
168175
}
169176

170177
/**

0 commit comments

Comments
 (0)
Please sign in to comment.