#562 Limiter DEFAULT_LIMIT optimization

This commit is contained in:
cloud.huang 2019-01-03 18:43:53 +08:00
parent 77881396a2
commit 5881214631

View File

@ -42,13 +42,12 @@ public class Limiter {
/** /**
* qps 5 * qps 5
*/ */
private static final String DEFAULT_LIMIT = "5";
private static double limit = 5; private static double limit = 5;
static { static {
try { try {
String limitTimeStr = System String limitTimeStr = System
.getProperty("limitTime", DEFAULT_LIMIT); .getProperty("limitTime", String.valueOf(limit));
limit = Double.parseDouble(limitTimeStr); limit = Double.parseDouble(limitTimeStr);
log.info("limitTime:{}", limit); log.info("limitTime:{}", limit);
} catch (Exception e) { } catch (Exception e) {