Removing unnecessary checks in SystemRuleManager#checkSystem (#2869)

This commit is contained in:
Ze 2022-09-15 09:33:56 +08:00 committed by GitHub
parent 6c74a4cf70
commit 9ac8e89dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -302,18 +302,18 @@ public final class SystemRuleManager {
} }
// total qps // total qps
double currentQps = Constants.ENTRY_NODE == null ? 0.0 : Constants.ENTRY_NODE.passQps(); double currentQps = Constants.ENTRY_NODE.passQps();
if (currentQps + count > qps) { if (currentQps + count > qps) {
throw new SystemBlockException(resourceWrapper.getName(), "qps"); throw new SystemBlockException(resourceWrapper.getName(), "qps");
} }
// total thread // total thread
int currentThread = Constants.ENTRY_NODE == null ? 0 : Constants.ENTRY_NODE.curThreadNum(); int currentThread = Constants.ENTRY_NODE.curThreadNum();
if (currentThread > maxThread) { if (currentThread > maxThread) {
throw new SystemBlockException(resourceWrapper.getName(), "thread"); 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) { if (rt > maxRt) {
throw new SystemBlockException(resourceWrapper.getName(), "rt"); throw new SystemBlockException(resourceWrapper.getName(), "rt");
} }