Authored by hugufei

fix PersionalRateLimitService

... ... @@ -19,10 +19,7 @@ public class PersionalRateLimitService {
public boolean isPersionalRateLimit(String rateLimitName, PersionalRateLimitConfig limitConfig) {
try {
long expireTime = System.currentTimeMillis() + limitConfig.getSecond() * 1000L;
KeyCountWithExpiredTime keyCountWithExpiredTime = keyCountMap.putIfAbsent(rateLimitName, new KeyCountWithExpiredTime(expireTime));
if (keyCountWithExpiredTime == null) {
keyCountWithExpiredTime = keyCountMap.get(rateLimitName);
}
KeyCountWithExpiredTime keyCountWithExpiredTime = keyCountMap.computeIfAbsent(rateLimitName, k->new KeyCountWithExpiredTime(expireTime));
int currentCount = keyCountWithExpiredTime.incrementAndGet(expireTime);
Integer oldCount = oldCountMap.get(rateLimitName);
//第二轮再开始打上一轮降级日志
... ...