额外邀请 统计发放次数
This commit is contained in:
@@ -32,7 +32,7 @@ public class DebounceAspect {
|
||||
|
||||
// 用于存储基于方法和入参情况的上次执行时间,结构为:方法签名 -> (入参值 -> 上次执行时间)
|
||||
private static final ConcurrentHashMap<String, ConcurrentHashMap<Object, Long>> executionTimeMap = new ConcurrentHashMap<>();
|
||||
private static final ReentrantLock lock = new ReentrantLock();
|
||||
private static final ReentrantLock LOCK = new ReentrantLock();
|
||||
|
||||
@Around("logPointCut()")
|
||||
public Object aroundDebounce(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
@@ -95,7 +95,7 @@ public class DebounceAspect {
|
||||
|
||||
public void cleanExpiredRecords() {
|
||||
long expirationTime = System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(10);
|
||||
lock.lock();
|
||||
LOCK.lock();
|
||||
try {
|
||||
for (Entry<String, ConcurrentHashMap<Object, Long>> outerEntry : executionTimeMap.entrySet()) {
|
||||
String methodSignature = outerEntry.getKey();
|
||||
@@ -112,7 +112,7 @@ public class DebounceAspect {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
LOCK.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
*/
|
||||
public class SpelUtil {
|
||||
/**
|
||||
* 用于SpEL表达式解析.
|
||||
|
||||
Reference in New Issue
Block a user