Merge pull request #563 from huangyunbin/limiter

#562 Limiter DEFAULT_LIMIT optimization
This commit is contained in:
Keep 2019-01-08 11:28:00 +08:00 committed by GitHub
commit 33e5e47832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -40,9 +40,9 @@ It is super easy to get started with your first project.
You can download the package from the [latest stable release](https://github.com/alibaba/nacos/releases). You can download the package from the [latest stable release](https://github.com/alibaba/nacos/releases).
Take release nacos-server-0.6.1.zip for example. Take release nacos-server-0.7.0.zip for example.
``` ```
unzip nacos-server-0.6.1.zip unzip nacos-server-0.7.0.zip
cd nacos/bin cd nacos/bin
``` ```

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) {