|
@@ -35,13 +35,14 @@ import java.util.Properties;
|
|
|
* @date 2019年7月24日
|
|
|
* @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
|
|
|
*/
|
|
|
+@Deprecated
|
|
|
public class ApiFlowLimitedInterceptor implements HandlerInterceptor {
|
|
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(ApiFlowLimitedInterceptor.class);
|
|
|
|
|
|
private static RateLimiter rateLimiter;
|
|
|
|
|
|
- private static boolean enable = true;
|
|
|
+ private static boolean enable = false;
|
|
|
|
|
|
private static int allowedRate = 0;
|
|
|
|
|
@@ -54,14 +55,14 @@ public class ApiFlowLimitedInterceptor implements HandlerInterceptor {
|
|
|
private static Map<String, Integer> permitsPerSecondMap = Maps.newConcurrentMap();
|
|
|
|
|
|
static {
|
|
|
- init();
|
|
|
+ // init();
|
|
|
}
|
|
|
|
|
|
private static void init() {
|
|
|
int permitsPerSecond = PropertyHolder.getInt("examcloud.api.permitsPerSecond", 100000);
|
|
|
rateLimiter = RateLimiter.create(permitsPerSecond);
|
|
|
|
|
|
- enable = PropertyHolder.getBoolean("examcloud.api.flowLimited.enable", true);
|
|
|
+ enable = PropertyHolder.getBoolean("examcloud.api.flowLimited.enable", false);
|
|
|
allowedRate = PropertyHolder.getInt("examcloud.api.flowLimited.allowedRate", 5);
|
|
|
minCallRate = PropertyHolder.getInt("examcloud.api.flowLimited.minCallRate", 10);
|
|
|
|