If user specifies an interval of 0, convert aggregation to NONE
This prevents an endless loop that can hang up the server, and is probably what the user intuitively wanted. Merge remote-tracking branch 'origin/zero_interval' into zero_interval Fix merge issue Fix whitespace to match original More whitespace
This commit is contained in:
parent
160aa7ac04
commit
b1bc922d16
@ -134,7 +134,10 @@ public class TelemetryRestMsgHandler extends DefaultRestMsgHandler {
|
|||||||
msg.getResponseHolder().setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
msg.getResponseHolder().setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Aggregation agg = Aggregation.valueOf(request.getParameter("agg", Aggregation.NONE.name()));
|
|
||||||
|
// If interval is 0, convert this to a NONE aggregation, which is probably what the user really wanted
|
||||||
|
Aggregation agg = (interval.isPresent() && interval.get() == 0) ? Aggregation.valueOf(Aggregation.NONE.name()) :
|
||||||
|
Aggregation.valueOf(request.getParameter("agg", Aggregation.NONE.name()));
|
||||||
|
|
||||||
List<TsKvQuery> queries = keys.stream().map(key -> new BaseTsKvQuery(key, startTs.get(), endTs.get(), interval.get(), limit.orElse(TelemetryWebsocketMsgHandler.DEFAULT_LIMIT), agg))
|
List<TsKvQuery> queries = keys.stream().map(key -> new BaseTsKvQuery(key, startTs.get(), endTs.get(), interval.get(), limit.orElse(TelemetryWebsocketMsgHandler.DEFAULT_LIMIT), agg))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user