mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 04:02:09 +08:00
feature #IAY66T 修改Springboot配置
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.enums.ParseModeEnum;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -99,11 +100,33 @@ public class LiteflowProperty {
|
||||
//是否启用节点实例ID
|
||||
private boolean enableNodeInstanceId;
|
||||
|
||||
// 是否启用规则缓存
|
||||
private Boolean enableRuleCache;
|
||||
// 规则缓存配置
|
||||
@NestedConfigurationProperty
|
||||
private RuleCache ruleCache;
|
||||
|
||||
// 规则缓存容量
|
||||
private Integer ruleCacheCapacity;
|
||||
public static class RuleCache {
|
||||
// 是否启用规则缓存
|
||||
private Boolean enabled;
|
||||
|
||||
// 规则缓存容量
|
||||
private Integer capacity;
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Integer getCapacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public void setCapacity(Integer capacity) {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnableMonitorFile() {
|
||||
return enableMonitorFile;
|
||||
@@ -337,19 +360,11 @@ public class LiteflowProperty {
|
||||
this.enableNodeInstanceId = enableNodeInstanceId;
|
||||
}
|
||||
|
||||
public Integer getRuleCacheCapacity() {
|
||||
return ruleCacheCapacity;
|
||||
public RuleCache getRuleCache() {
|
||||
return ruleCache;
|
||||
}
|
||||
|
||||
public void setRuleCacheCapacity(Integer ruleCacheCapacity) {
|
||||
this.ruleCacheCapacity = ruleCacheCapacity;
|
||||
}
|
||||
|
||||
public Boolean isEnableRuleCache() {
|
||||
return enableRuleCache;
|
||||
}
|
||||
|
||||
public void setEnableRuleCache(Boolean enableRuleCache) {
|
||||
this.enableRuleCache = enableRuleCache;
|
||||
public void setRuleCache(RuleCache ruleCache) {
|
||||
this.ruleCache = ruleCache;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ public class LiteflowPropertyAutoConfiguration {
|
||||
liteflowConfig.setGlobalThreadPoolQueueSize(property.getGlobalThreadPoolQueueSize());
|
||||
liteflowConfig.setGlobalThreadPoolSize(property.getGlobalThreadPoolSize());
|
||||
liteflowConfig.setEnableNodeInstanceId(property.isEnableNodeInstanceId());
|
||||
liteflowConfig.setEnableRuleCache(property.isEnableRuleCache());
|
||||
liteflowConfig.setRuleCacheCapacity(property.getRuleCacheCapacity());
|
||||
liteflowConfig.setEnableRuleCache(property.getRuleCache().getEnabled());
|
||||
liteflowConfig.setRuleCacheCapacity(property.getRuleCache().getCapacity());
|
||||
return liteflowConfig;
|
||||
}
|
||||
|
||||
|
||||
@@ -208,14 +208,14 @@
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"name": "liteflow.enable-rule-cache",
|
||||
"name": "liteflow.rule-cache.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enable rule cache.",
|
||||
"sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"name": "liteflow.rule-cache-capacity",
|
||||
"name": "liteflow.rule-cache.capacity",
|
||||
"type": "java.lang.Integer",
|
||||
"description": "Set rule cache capacity.",
|
||||
"sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty"
|
||||
|
||||
@@ -24,5 +24,5 @@ liteflow.global-thread-pool-size=16
|
||||
liteflow.global-thread-pool-queue-size=512
|
||||
liteflow.global-thread-pool-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder
|
||||
liteflow.enable-node-instance-id=false
|
||||
liteflow.enable-rule-cache=false
|
||||
liteflow.rule-cache.enabled=false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user