优化Etcd的节点获取逻辑

This commit is contained in:
everywhere.z 2022-11-11 10:23:38 +08:00
parent 39c94e77d0
commit 2408bd1652
1 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
* @author zendwang
@ -92,7 +94,7 @@ public class EtcdParserHelper {
//检查是否有脚本内容如果有进行脚本内容的获取
String scriptAllContent = StrUtil.EMPTY;
if (hasScript()){
List<String> scriptNodeValueList = client.getChildrenKeys(etcdParserVO.getScriptPath(), SEPARATOR);
List<String> scriptNodeValueList = client.getChildrenKeys(etcdParserVO.getScriptPath(), SEPARATOR).stream().filter(StrUtil::isNotBlank).collect(Collectors.toList());
List<String> scriptItemContentList = new ArrayList<>();
for (String scriptNodeValue: scriptNodeValueList){