From 14ce4a6a5116578c8fda27108cee807bd0fa3a79 Mon Sep 17 00:00:00 2001 From: bryan31 Date: Thu, 20 May 2021 00:53:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liteflow/parser/ZookeeperXmlFlowParser.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ZookeeperXmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ZookeeperXmlFlowParser.java index a5ac76a7d..5496c10c6 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ZookeeperXmlFlowParser.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ZookeeperXmlFlowParser.java @@ -4,6 +4,7 @@ import java.text.MessageFormat; import cn.hutool.core.util.StrUtil; +import com.yomahub.liteflow.flow.FlowBus; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.recipes.cache.NodeCache; @@ -57,13 +58,11 @@ public class ZookeeperXmlFlowParser extends XmlFlowParser{ final NodeCache cache = new NodeCache(client,nodePath); cache.start(); - cache.getListenable().addListener(new NodeCacheListener() { - @Override - public void nodeChanged() throws Exception { - String content = new String(cache.getCurrentData().getData()); - LOG.info("stating load flow config...."); - parse(content); - } + cache.getListenable().addListener(() -> { + String content1 = new String(cache.getCurrentData().getData()); + LOG.info("stating load flow config...."); + FlowBus.cleanCache(); + parse(content1); }); } }