From 252c81dd156dc9b4b8077d86dff8dcfe3a4ef770 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Fri, 19 Apr 2024 17:05:32 +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 --- .../yomahub/liteflow/parser/sql/read/SqlReadFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/liteflow-rule-plugin/liteflow-rule-sql/src/main/java/com/yomahub/liteflow/parser/sql/read/SqlReadFactory.java b/liteflow-rule-plugin/liteflow-rule-sql/src/main/java/com/yomahub/liteflow/parser/sql/read/SqlReadFactory.java index b08de78a..281f7798 100644 --- a/liteflow-rule-plugin/liteflow-rule-sql/src/main/java/com/yomahub/liteflow/parser/sql/read/SqlReadFactory.java +++ b/liteflow-rule-plugin/liteflow-rule-sql/src/main/java/com/yomahub/liteflow/parser/sql/read/SqlReadFactory.java @@ -23,16 +23,16 @@ public class SqlReadFactory { private static final Map POLL_TASK_MAP = new HashMap<>(); public static void registerRead(SQLParserVO config) { - READ_MAP.put(ReadType.CHAIN, new ChainRead(config)); - READ_MAP.put(ReadType.SCRIPT, new ScriptRead(config)); + READ_MAP.putIfAbsent(ReadType.CHAIN, new ChainRead(config)); + READ_MAP.putIfAbsent(ReadType.SCRIPT, new ScriptRead(config)); } public static void registerSqlReadPollTask(ReadType readType) { SqlRead sqlRead = getSqlRead(readType); if (ReadType.CHAIN.equals(readType)) { - POLL_TASK_MAP.put(ReadType.CHAIN, new ChainReadPollTask(sqlRead)); + POLL_TASK_MAP.putIfAbsent(ReadType.CHAIN, new ChainReadPollTask(sqlRead)); } else if (ReadType.SCRIPT.equals(readType)) { - POLL_TASK_MAP.put(ReadType.SCRIPT, new ScriptReadPollTask(sqlRead)); + POLL_TASK_MAP.putIfAbsent(ReadType.SCRIPT, new ScriptReadPollTask(sqlRead)); } }