|
@@ -43,7 +43,7 @@ public class ApiFlowLimitedInterceptor implements HandlerInterceptor {
|
|
|
private static final ExamCloudLog INTERFACE_LOG = ExamCloudLogFactory
|
|
|
.getLog("INTERFACE_LOGGER");
|
|
|
|
|
|
- private static final RateLimiter rateLimiter;
|
|
|
+ private static RateLimiter rateLimiter;
|
|
|
|
|
|
private static boolean enable = true;
|
|
|
|
|
@@ -58,6 +58,10 @@ public class ApiFlowLimitedInterceptor implements HandlerInterceptor {
|
|
|
private static Map<String, Long> permitsPerSecondMap = Maps.newConcurrentMap();
|
|
|
|
|
|
static {
|
|
|
+ init();
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void init() {
|
|
|
|
|
|
double permitsPerSecond = PropertyHolder.getInt("examcloud.api.permitsPerSecond", 100000);
|
|
|
rateLimiter = RateLimiter.create(permitsPerSecond);
|