feature #IAY66T 增加缓存容量配置

This commit is contained in:
DaleLee
2024-11-09 19:18:14 +08:00
parent 2903d7c9c2
commit 513a3f3ed1
4 changed files with 34 additions and 0 deletions

View File

@@ -127,6 +127,9 @@ public class LiteflowConfig {
//是否启用节点实例ID
private Boolean enableNodeInstanceId;
// 规则缓存容量
private Integer ruleCacheCapacity;
public Boolean getEnableMonitorFile() {
return enableMonitorFile;
}
@@ -524,4 +527,17 @@ public class LiteflowConfig {
public void setEnableNodeInstanceId(Boolean enableNodeInstanceId) {
this.enableNodeInstanceId = enableNodeInstanceId;
}
public Integer getRuleCacheCapacity() {
return ruleCacheCapacity;
}
public void setRuleCacheCapacity(Integer ruleCacheCapacity) {
this.ruleCacheCapacity = ruleCacheCapacity;
}
public boolean isRuleCacheEnabled() {
return ObjectUtil.isNotNull(ruleCacheCapacity) && ruleCacheCapacity > 0;
}
}

View File

@@ -104,6 +104,9 @@ public class LiteflowProperty {
//是否启用节点实例ID
private boolean enableNodeInstanceId;
// 规则缓存容量
private Integer ruleCacheCapacity;
public boolean isEnableMonitorFile() {
return enableMonitorFile;
}
@@ -347,4 +350,12 @@ public class LiteflowProperty {
public void setEnableNodeInstanceId(boolean enableNodeInstanceId) {
this.enableNodeInstanceId = enableNodeInstanceId;
}
public Integer getRuleCacheCapacity() {
return ruleCacheCapacity;
}
public void setRuleCacheCapacity(Integer ruleCacheCapacity) {
this.ruleCacheCapacity = ruleCacheCapacity;
}
}

View File

@@ -55,6 +55,7 @@ public class LiteflowPropertyAutoConfiguration {
liteflowConfig.setPeriod(liteflowMonitorProperty.getPeriod());
liteflowConfig.setScriptSetting(property.getScriptSetting());
liteflowConfig.setEnableNodeInstanceId(property.isEnableNodeInstanceId());
liteflowConfig.setRuleCacheCapacity(property.getRuleCacheCapacity());
return liteflowConfig;
}

View File

@@ -227,6 +227,12 @@
"description": "enable node instance id",
"sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
"defaultValue": false
},
{
"name": "liteflow.liteflow.rule-cache-capacity",
"type": "java.lang.Integer",
"description": "Set the rules cache capacity.",
"sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty"
}
]
}