Commit fbe3a910 by guo_minglei@163.com

获取执行状态

parent e0279415
......@@ -50,6 +50,8 @@ public class MythJobProcess implements Callable<String>{
private Integer logId;
//redis的发布key
private String runId;
//执行状态,默认是失败
private int exitCode = 1;
public MythJobProcess(final List<String> cmd, final Map<String, String> env,
final String workingDir, final Integer logId, final String runId) {
......@@ -115,7 +117,6 @@ public class MythJobProcess implements Callable<String>{
//开始获取进程的运行日志
outputGobbler.start();
errorGobbler.start();
int exitCode = -1;
try {
//获取进程的运行状态
exitCode = this.process.waitFor();
......@@ -159,6 +160,14 @@ public class MythJobProcess implements Callable<String>{
}
/**
* 获取执行状态
* @return
*/
public int getExitCode(){
return this.exitCode;
}
/**
* 等待进程执行完成
* <p>
* 当此方法返回时,作业过程已创建,并且this.processId已设置。
......
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