Commit 656a9477 by huangfusuper

增加永不超时选项

parent b83665f8
......@@ -24,39 +24,44 @@ public class JavaTaskCallbackThread implements Runnable {
public JavaTaskCallbackThread(PluginRpcResponsePacket pluginRpcResponsePacket) {
this.pluginRpcResponsePacket = pluginRpcResponsePacket;
}
@Override
public void run() {
String logIdStr = pluginRpcResponsePacket.getExtension();
int logId = Integer.parseInt(logIdStr);
JobTaskRunLogServiceImpl mythJobTaskRunLogService = SpringUtil.getBean(JobTaskRunLogServiceImpl.class);
Map<String,String> result = new HashMap<>(2);
Map<String, String> result = new HashMap<>(2);
Object returnReultObject = pluginRpcResponsePacket.getResult();
if(returnReultObject instanceof ReturnResult) {
if (returnReultObject instanceof ReturnResult) {
ReturnResult returnResult = (ReturnResult) returnReultObject;
result.put(CODE,returnResult.getCode());
result.put(MSG,returnResult.getMsg());
}else{
result = (Map<String,String>)returnReultObject;
result.put(CODE, returnResult.getCode());
result.put(MSG, returnResult.getMsg());
} else {
result = (Map<String, String>) returnReultObject;
}
JobTaskRunLogWithBLOBs jobTaskRunLog = new JobTaskRunLogWithBLOBs();
String code= result.get(CODE);
if(JobResultEnum.SUCCESS.getCode().equals(code)){
String code = result.get(CODE);
if (JobResultEnum.SUCCESS.getCode().equals(code)) {
code = RunResultEnum.RUN_SUCCESS.getCode();
}else if(JobResultEnum.DISPATCH_SUCCESS.getCode().equals(code)){
} else if (JobResultEnum.DISPATCH_SUCCESS.getCode().equals(code)) {
code = RunResultEnum.JOB_RUN_ING.getCode();
}else {
} else {
code = RunResultEnum.RUN_ERROR.getCode();
}
String logUrl = pluginRpcResponsePacket.getExtension1();
if(StringUtils.isNoneBlank(logUrl)){
if (StringUtils.isNoneBlank(logUrl)) {
jobTaskRunLog.setLogRemotelyPath(logUrl);
}
jobTaskRunLog.setRunMsg(result.get(MSG));
jobTaskRunLog.setRunCode(code);
jobTaskRunLog.setLogId(logId);
jobTaskRunLog.setEndTime(new Date());
String logPath = result.get("logPath");
if (StringUtils.isNoneBlank(logPath)) {
jobTaskRunLog.setLogRemotelyPath(logPath);
}
mythJobTaskRunLogService.updateJobTaskRunLogWithBLOBs(jobTaskRunLog);
}
......
......@@ -39,6 +39,9 @@ public class TimeoutExampleThreadRunHelper extends BaseThreadRunHelper {
List<RunRecording> allRunIng = runRecordingService.findAllRunIng(new FlowConditionDto());
List<RunRecording> timeoutRunRecordings = allRunIng.stream().filter(runRecording -> {
if(runRecording.getFlowTimeout() < 0){
return false;
}
Date startDate = runRecording.getStartTime();
if(startDate == null){
return false;
......
......@@ -24,6 +24,7 @@ public class ReturnResult<T> implements Serializable {
public static final ReturnResult<String> FAIL = new ReturnResult<>(JobResultEnum.FAIL.getCode(), JobResultEnum.FAIL.getMsg());
private String code;
private String msg;
private String logPath = "";
/**
* 只是一个介绍,对于类 content 的类型 JSON化
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment