Commit c428b587207277e9fb7c304c1a4cbfd744e511a1

Authored by Igor Kulikov
Committed by GitHub
2 parents 9e42855b 0fa0a6f1

Merge pull request #3783 from YevhenBondarenko/fix-api-usage-state

fixed hourly update api usage state
... ... @@ -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);
... ...