Commit c428b587207277e9fb7c304c1a4cbfd744e511a1
Committed by
GitHub
Merge pull request #3783 from YevhenBondarenko/fix-api-usage-state
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 | 166 | long newValue = tenantState.add(recordKey, kvProto.getValue()); |
167 | 167 | updatedEntries.add(new BasicTsKvEntry(ts, new LongDataEntry(recordKey.getApiCountKey(), newValue))); |
168 | 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 | 170 | apiFeatures.add(recordKey.getApiFeature()); |
171 | 171 | } |
172 | 172 | result = tenantState.checkStateUpdatedDueToThreshold(apiFeatures); | ... | ... |