Browse Source

feat #I6BDLN 绝对路径的目录位置及其所有子目录下规则配置文件的侦听

gaibu 2 years ago
parent
commit
c6953b0f18

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java

@@ -181,7 +181,7 @@ public class FlowExecutor {
         }
 
         // 文件监听
-        if (liteflowConfig.getMonitorFileEnable()){
+        if (liteflowConfig.getEnableMonitorFile()){
             MonitorFile.getInstance().create();
         }
     }

+ 5 - 5
liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java

@@ -95,14 +95,14 @@ public class LiteflowConfig {
     private String substituteCmpClass;
 
     // 规则文件/脚本文件变更监听
-    private Boolean monitorFileEnable = Boolean.TRUE;
+    private Boolean enableMonitorFile = Boolean.FALSE;
 
-    public Boolean getMonitorFileEnable() {
-        return monitorFileEnable;
+    public Boolean getEnableMonitorFile() {
+        return enableMonitorFile;
     }
 
-    public void setMonitorFileEnable(Boolean monitorFileEnable) {
-        this.monitorFileEnable = monitorFileEnable;
+    public void setEnableMonitorFile(Boolean enableMonitorFile) {
+        this.enableMonitorFile = enableMonitorFile;
     }
 
     public Boolean getEnable() {

+ 11 - 0
liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java

@@ -70,6 +70,17 @@ public class LiteflowProperty {
     //替补组件的class路径
     private String substituteCmpClass;
 
+    // 规则文件/脚本文件变更监听
+    private Boolean enableMonitorFile;
+
+    public Boolean getEnableMonitorFile() {
+        return enableMonitorFile;
+    }
+
+    public void setEnableMonitorFile(Boolean enableMonitorFile) {
+        this.enableMonitorFile = enableMonitorFile;
+    }
+
     public boolean isEnable() {
         return enable;
     }

+ 1 - 0
liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java

@@ -47,6 +47,7 @@ public class LiteflowPropertyAutoConfiguration {
         liteflowConfig.setMainExecutorClass(property.getMainExecutorClass());
         liteflowConfig.setPrintExecutionLog(property.isPrintExecutionLog());
         liteflowConfig.setSubstituteCmpClass(property.getSubstituteCmpClass());
+        liteflowConfig.setEnableMonitorFile(property.getEnableMonitorFile());
         return liteflowConfig;
     }
 }

+ 7 - 0
liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@@ -158,6 +158,13 @@
       "description": "Set period time to print monitor log.",
       "sourceType": "com.yomahub.liteflow.springboot.LiteflowMonitorProperty",
       "defaultValue": 300000
+    },
+    {
+      "name": "liteflow.enable-monitor-file",
+      "type": "java.lang.Boolean",
+      "description": "Set file change monitoring.",
+      "sourceType": "com.yomahub.liteflow.springboot.LiteflowMonitorProperty",
+      "defaultValue": false
     }
   ]
 }

+ 1 - 0
liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties

@@ -18,3 +18,4 @@ liteflow.monitor.enable-log=false
 liteflow.monitor.queue-limit=200
 liteflow.monitor.delay=300000
 liteflow.monitor.period=300000
+liteflow.enable-monitor-file=false