From 9ac8e89dc404c49a352167f1100855d16bb0c208 Mon Sep 17 00:00:00 2001 From: Ze <281918681@qq.com> Date: Thu, 15 Sep 2022 09:33:56 +0800 Subject: [PATCH] Removing unnecessary checks in SystemRuleManager#checkSystem (#2869) --- .../csp/sentinel/slots/system/SystemRuleManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 4ee5f17c..64d54be9 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 @@ -302,18 +302,18 @@ public final class SystemRuleManager { } // total qps - double currentQps = Constants.ENTRY_NODE == null ? 0.0 : Constants.ENTRY_NODE.passQps(); + double currentQps = Constants.ENTRY_NODE.passQps(); if (currentQps + count > qps) { throw new SystemBlockException(resourceWrapper.getName(), "qps"); } // total thread - int currentThread = Constants.ENTRY_NODE == null ? 0 : Constants.ENTRY_NODE.curThreadNum(); + int currentThread = Constants.ENTRY_NODE.curThreadNum(); if (currentThread > maxThread) { throw new SystemBlockException(resourceWrapper.getName(), "thread"); } - double rt = Constants.ENTRY_NODE == null ? 0 : Constants.ENTRY_NODE.avgRt(); + double rt = Constants.ENTRY_NODE.avgRt(); if (rt > maxRt) { throw new SystemBlockException(resourceWrapper.getName(), "rt"); }