fix: Change check order and The first line indentation (#614)

pull/650/head
pizihao 3 years ago
parent cfc830ff75
commit b6f02b6adc

@ -95,10 +95,10 @@ public abstract class AbstractRefreshListener<M> implements RefreshListener<Hipp
}
String[] splitNodes = nodes.split(SEPARATOR);
return Arrays.stream(splitNodes)
.distinct()
.map(IpAndPort::build)
.filter(Objects::nonNull)
.anyMatch(i -> i.check(ipSegment, port));
.distinct()
.map(IpAndPort::build)
.filter(Objects::nonNull)
.anyMatch(i -> i.check(ipSegment, port));
}
/**

@ -61,7 +61,7 @@ public class AdapterExecutorsRefreshListener extends AbstractRefreshListener<Ada
continue;
}
if (!Objects.equals(adapterExecutorProperties.getCorePoolSize(), each.getCorePoolSize())
|| !Objects.equals(adapterExecutorProperties.getMaximumPoolSize(), each.getMaximumPoolSize())) {
|| !Objects.equals(adapterExecutorProperties.getMaximumPoolSize(), each.getMaximumPoolSize())) {
threadPoolAdapterMap.forEach((key, val) -> {
if (Objects.equals(val.mark(), each.getMark())) {
val.updateThreadPool(BeanUtil.toBean(each, ThreadPoolAdapterParameter.class));

@ -79,13 +79,16 @@ public class DynamicThreadPoolRefreshListener extends AbstractRefreshListener<Ex
List<ExecutorProperties> executors = bindableConfigProperties.getExecutors();
for (ExecutorProperties properties : executors) {
String threadPoolId = properties.getThreadPoolId();
if (!match(properties) || !checkConsistency(threadPoolId, properties)) {
if (!match(properties)) {
continue;
}
/*
* Check whether the notification configuration is consistent, this operation will not trigger the notification.
*/
checkNotifyConsistencyAndReplace(properties);
if (!checkConsistency(threadPoolId, properties)) {
continue;
}
dynamicRefreshPool(threadPoolId, properties);
ExecutorProperties beforeProperties = GlobalCoreThreadPoolManage.getProperties(properties.getThreadPoolId());
GlobalCoreThreadPoolManage.refresh(threadPoolId, failDefaultExecutorProperties(beforeProperties, properties));

Loading…
Cancel
Save