瀏覽代碼

Set SystemRule's threshold to zero is allowed.

master
Carpenter Lee 6 年之前
父節點
當前提交
40514587ac
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. +4
    -4
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/system/SystemRuleManager.java

+ 4
- 4
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/system/SystemRuleManager.java 查看文件

@@ -226,24 +226,24 @@ public class SystemRuleManager {
boolean checkStatus = false;
// 首先判断是否有效

if (rule.getHighestSystemLoad() > 0) {
if (rule.getHighestSystemLoad() >= 0) {
highestSystemLoad = Math.min(highestSystemLoad, rule.getHighestSystemLoad());
highestSystemLoadIsSet = true;
checkStatus = true;
}

if (rule.getAvgRt() > 0) {
if (rule.getAvgRt() >= 0) {
maxRt = Math.min(maxRt, rule.getAvgRt());
maxRtIsSet = true;
checkStatus = true;
}
if (rule.getMaxThread() > 0) {
if (rule.getMaxThread() >= 0) {
maxThread = Math.min(maxThread, rule.getMaxThread());
maxThreadIsSet = true;
checkStatus = true;
}

if (rule.getQps() > 0) {
if (rule.getQps() >= 0) {
qps = Math.min(qps, rule.getQps());
qpsIsSet = true;
checkStatus = true;


Loading…
取消
儲存