diff --git a/backend/shared/domain-common/src/main/java/com/datamate/common/setting/application/SysParamApplicationService.java b/backend/shared/domain-common/src/main/java/com/datamate/common/setting/application/SysParamApplicationService.java index dcf2f6d2..54b465c0 100644 --- a/backend/shared/domain-common/src/main/java/com/datamate/common/setting/application/SysParamApplicationService.java +++ b/backend/shared/domain-common/src/main/java/com/datamate/common/setting/application/SysParamApplicationService.java @@ -12,6 +12,7 @@ import java.util.Comparator; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; /** * 系统参数应用服务 @@ -25,6 +26,7 @@ public class SysParamApplicationService { private final SysParamRepository sysParamRepository; private final RedisClient redisClient; + private final AtomicBoolean redisEnable = new AtomicBoolean(true); /** * 列表查询系统参数 @@ -59,17 +61,18 @@ public void deleteParamById(String paramKey) { } public String getParamByKey(String paramId) { - boolean redisEnable = false; String value = null; - try { - value = redisClient.getParamWithThrow(paramId); - redisEnable = true; - } catch (Exception e) { - log.warn(e.getMessage()); + if (redisEnable.get()) { + try { + value = redisClient.getParamWithThrow(paramId); + } catch (Exception e) { + redisEnable.set(false); + log.warn(e.getMessage()); + } } if (value == null) { SysParam sysParam = sysParamRepository.getById(paramId); - if (sysParam != null && redisEnable) { + if (sysParam != null) { value = sysParam.getParamValue(); } } diff --git a/frontend/src/pages/DataCleansing/Create/components/ParamConfig.tsx b/frontend/src/pages/DataCleansing/Create/components/ParamConfig.tsx index dc8a79db..860a8973 100644 --- a/frontend/src/pages/DataCleansing/Create/components/ParamConfig.tsx +++ b/frontend/src/pages/DataCleansing/Create/components/ParamConfig.tsx @@ -8,6 +8,7 @@ import { InputNumber, Slider, Space, + Switch, } from "antd"; import { ConfigI, OperatorI } from "@/pages/OperatorMarket/operator.model"; @@ -215,12 +216,12 @@ const ParamConfig: React.FC = ({ tooltip={param.description} key={paramKey} > - updateValue(e.target.checked)} - > - {param.name} - + updateValue(checked)} + /> ); case "multiple": diff --git a/runtime/ops/filter/img_similar_images_cleaner/process.py b/runtime/ops/filter/img_similar_images_cleaner/process.py index 9121818b..1aaea841 100644 --- a/runtime/ops/filter/img_similar_images_cleaner/process.py +++ b/runtime/ops/filter/img_similar_images_cleaner/process.py @@ -139,8 +139,8 @@ def get_orb_similarity(self, des_matrix: np.ndarray, des_matrix_history: np.ndar orb_similarity = count / len(matches) return orb_similarity except Exception as e: - logger.exception(f"taskId: {self.task_uuid}, failed to compare the similarity between " - f"{file_name} and {file_name_history}: {e}") + logger.exception(f"taskId: {self.task_uuid}, failed to compare the similarity between " + f"{file_name} and {file_name_history}: {e}") return 0.0 def execute_sql(self, p_hash: str, des_matrix: np.ndarray, file_name: str, diff --git a/runtime/ops/mapper/html_tag_cleaner/metadata.yml b/runtime/ops/mapper/html_tag_cleaner/metadata.yml index ac862bd8..38b88939 100644 --- a/runtime/ops/mapper/html_tag_cleaner/metadata.yml +++ b/runtime/ops/mapper/html_tag_cleaner/metadata.yml @@ -14,3 +14,12 @@ effect: after: '机器学习是人工智能的一个分支。' inputs: 'text' outputs: 'text' +settings: + removeTableTags: + name: '是否去除表格标签' + description: '若为是,则会去除表格标签等。' + type: 'switch' + defaultVal: 'false' + required: false + checkedLabel: '是' + unCheckedLabel: '否' diff --git a/runtime/ops/mapper/html_tag_cleaner/process.py b/runtime/ops/mapper/html_tag_cleaner/process.py index 257d3306..08931e55 100644 --- a/runtime/ops/mapper/html_tag_cleaner/process.py +++ b/runtime/ops/mapper/html_tag_cleaner/process.py @@ -34,8 +34,14 @@ class HtmlTagCleaner(Mapper): '', '