From 40514587acafec5bb97bb99a0875d433fd426a2c Mon Sep 17 00:00:00 2001 From: Carpenter Lee Date: Wed, 8 Aug 2018 14:33:13 +0800 Subject: [PATCH] Set SystemRule's threshold to zero is allowed. --- .../csp/sentinel/slots/system/SystemRuleManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/system/SystemRuleManager.java b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/system/SystemRuleManager.java index 21f6ee4f..d5a8ccc7 100755 --- a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/system/SystemRuleManager.java +++ b/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;