GLUE脚本文件自动清理功能,及时清理过期脚本文件;
This commit is contained in:
parent
347306536c
commit
7d9f677948
|
@ -1241,8 +1241,9 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
|
||||||
- 25、任务调度备注中标注任务触发类型,如Cron触发、父任务触发、API触发等等,方便排查调度日志;
|
- 25、任务调度备注中标注任务触发类型,如Cron触发、父任务触发、API触发等等,方便排查调度日志;
|
||||||
- 26、底层日志组件SimpleDateFormat线程安全问题修复;
|
- 26、底层日志组件SimpleDateFormat线程安全问题修复;
|
||||||
- 27、执行器通讯线程优化,corePoolSize从256降低至32;
|
- 27、执行器通讯线程优化,corePoolSize从256降低至32;
|
||||||
- 28、【迭代中】新增任务运行模式 "GLUE模式(PowerShell) ",支持PowerShell脚本任务;
|
- 28、新增任务运行模式 "GLUE模式(PowerShell) ",支持PowerShell脚本任务;
|
||||||
- 29、【迭代中】分片任务失败重试优化,仅重试当前失败的分片;
|
- 29、GLUE脚本文件自动清理功能,及时清理过期脚本文件;
|
||||||
|
- 30、【迭代中】分片任务失败重试优化,仅重试当前失败的分片;
|
||||||
|
|
||||||
|
|
||||||
### TODO LIST
|
### TODO LIST
|
||||||
|
|
|
@ -25,6 +25,20 @@ public class ScriptJobHandler extends IJobHandler {
|
||||||
this.glueUpdatetime = glueUpdatetime;
|
this.glueUpdatetime = glueUpdatetime;
|
||||||
this.gluesource = gluesource;
|
this.gluesource = gluesource;
|
||||||
this.glueType = glueType;
|
this.glueType = glueType;
|
||||||
|
|
||||||
|
// clean old script file
|
||||||
|
File glueSrcPath = new File(XxlJobFileAppender.getGlueSrcPath());
|
||||||
|
if (glueSrcPath.exists()) {
|
||||||
|
File[] glueSrcFileList = glueSrcPath.listFiles();
|
||||||
|
if (glueSrcFileList!=null && glueSrcFileList.length>0) {
|
||||||
|
for (File glueSrcFileItem : glueSrcFileList) {
|
||||||
|
if (glueSrcFileItem.getName().startsWith(String.valueOf(jobId)+"_")) {
|
||||||
|
glueSrcFileItem.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getGlueUpdatetime() {
|
public long getGlueUpdatetime() {
|
||||||
|
@ -48,7 +62,10 @@ public class ScriptJobHandler extends IJobHandler {
|
||||||
.concat("_")
|
.concat("_")
|
||||||
.concat(String.valueOf(glueUpdatetime))
|
.concat(String.valueOf(glueUpdatetime))
|
||||||
.concat(glueType.getSuffix());
|
.concat(glueType.getSuffix());
|
||||||
|
File scriptFile = new File(scriptFileName);
|
||||||
|
if (!scriptFile.exists()) {
|
||||||
ScriptUtil.markScriptFile(scriptFileName, gluesource);
|
ScriptUtil.markScriptFile(scriptFileName, gluesource);
|
||||||
|
}
|
||||||
|
|
||||||
// log file
|
// log file
|
||||||
String logFileName = XxlJobFileAppender.contextHolder.get();
|
String logFileName = XxlJobFileAppender.contextHolder.get();
|
||||||
|
|
Loading…
Reference in New Issue