Browse Source

Do not load all data if it is not in the current time interval

pull/4257/head
Alejandro Santana Lima 6 years ago
committed by Andrew Shvayka
parent
commit
5820c5446b
  1. 4
      application/src/main/java/org/thingsboard/server/service/subscription/DefaultSubscriptionManagerService.java

4
application/src/main/java/org/thingsboard/server/service/subscription/DefaultSubscriptionManagerService.java

@ -434,7 +434,9 @@ public class DefaultSubscriptionManagerService extends TbApplicationEventListene
if (curTs > value) {
long startTs = subscription.getStartTime() > 0 ? Math.max(subscription.getStartTime(), value + 1L) : (value + 1L);
long endTs = subscription.getEndTime() > 0 ? Math.min(subscription.getEndTime(), curTs) : curTs;
queries.add(new BaseReadTsKvQuery(key, startTs, endTs, 0, 1000, Aggregation.NONE));
if (startTs > 1) {
queries.add(new BaseReadTsKvQuery(key, startTs, endTs, 0, 1000, Aggregation.NONE));
}
}
});
if (!queries.isEmpty()) {

Loading…
Cancel
Save