Fixed an issue where the maximum number of anti-fragile plug-ins implemented by default in Nacos is one more than the actual number of connections. (#11636)
This commit is contained in:
parent
f5d72a3455
commit
30a5014e5d
@ -62,7 +62,7 @@ public class NacosConnectionControlManager extends ConnectionControlManager {
|
||||
Map<String, Integer> metricsTotalCount = metricsCollectorList.stream().collect(
|
||||
Collectors.toMap(ConnectionMetricsCollector::getName, ConnectionMetricsCollector::getTotalCount));
|
||||
int totalCount = metricsTotalCount.values().stream().mapToInt(Integer::intValue).sum();
|
||||
if (totalCount > totalCountLimit) {
|
||||
if (totalCount >= totalCountLimit) {
|
||||
connectionCheckResponse.setSuccess(false);
|
||||
connectionCheckResponse.setCode(ConnectionCheckCode.DENY_BY_TOTAL_OVER);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user