Browse Source
Merge pull request #3783 from YevhenBondarenko/fix-api-usage-state
fixed hourly update api usage state
pull/3791/head
Igor Kulikov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files 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 { |
|
|
|
long newValue = tenantState.add(recordKey, kvProto.getValue()); |
|
|
|
updatedEntries.add(new BasicTsKvEntry(ts, new LongDataEntry(recordKey.getApiCountKey(), newValue))); |
|
|
|
long newHourlyValue = tenantState.addToHourly(recordKey, kvProto.getValue()); |
|
|
|
updatedEntries.add(new BasicTsKvEntry(hourTs, new LongDataEntry(recordKey.getApiCountKey() + HOURLY, newHourlyValue))); |
|
|
|
updatedEntries.add(new BasicTsKvEntry(newHourTs, new LongDataEntry(recordKey.getApiCountKey() + HOURLY, newHourlyValue))); |
|
|
|
apiFeatures.add(recordKey.getApiFeature()); |
|
|
|
} |
|
|
|
result = tenantState.checkStateUpdatedDueToThreshold(apiFeatures); |
|
|
|
|