Commit 656a9477 by huangfusuper

增加永不超时选项

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