Commit 0fa0a6f1d462a5879719a25b5170070bed2223ba
1 parent
c32a2ac0
fixed hourly update api usage state
Showing
1 changed file
with
1 additions
and
1 deletions
application/src/main/java/org/thingsboard/server/service/apiusage/DefaultTbApiUsageStateService.java
@@ -166,7 +166,7 @@ public class DefaultTbApiUsageStateService implements TbApiUsageStateService { | @@ -166,7 +166,7 @@ public class DefaultTbApiUsageStateService implements TbApiUsageStateService { | ||
166 | long newValue = tenantState.add(recordKey, kvProto.getValue()); | 166 | long newValue = tenantState.add(recordKey, kvProto.getValue()); |
167 | updatedEntries.add(new BasicTsKvEntry(ts, new LongDataEntry(recordKey.getApiCountKey(), newValue))); | 167 | updatedEntries.add(new BasicTsKvEntry(ts, new LongDataEntry(recordKey.getApiCountKey(), newValue))); |
168 | long newHourlyValue = tenantState.addToHourly(recordKey, kvProto.getValue()); | 168 | long newHourlyValue = tenantState.addToHourly(recordKey, kvProto.getValue()); |
169 | - updatedEntries.add(new BasicTsKvEntry(hourTs, new LongDataEntry(recordKey.getApiCountKey() + HOURLY, newHourlyValue))); | 169 | + updatedEntries.add(new BasicTsKvEntry(newHourTs, new LongDataEntry(recordKey.getApiCountKey() + HOURLY, newHourlyValue))); |
170 | apiFeatures.add(recordKey.getApiFeature()); | 170 | apiFeatures.add(recordKey.getApiFeature()); |
171 | } | 171 | } |
172 | result = tenantState.checkStateUpdatedDueToThreshold(apiFeatures); | 172 | result = tenantState.checkStateUpdatedDueToThreshold(apiFeatures); |