|
|
@ -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());
|
|
|
|
ScriptUtil.markScriptFile(scriptFileName, gluesource);
|
|
|
|
File scriptFile = new File(scriptFileName);
|
|
|
|
|
|
|
|
if (!scriptFile.exists()) {
|
|
|
|
|
|
|
|
ScriptUtil.markScriptFile(scriptFileName, gluesource);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// log file
|
|
|
|
// log file
|
|
|
|
String logFileName = XxlJobFileAppender.contextHolder.get();
|
|
|
|
String logFileName = XxlJobFileAppender.contextHolder.get();
|
|
|
|