Commit daf754dc by huangfusuper

kill杀死任务接口

parent 7ff0d8f0
...@@ -22,9 +22,7 @@ public class ProcessManagerController { ...@@ -22,9 +22,7 @@ public class ProcessManagerController {
public String killJob(Integer logId){ public String killJob(Integer logId){
ValidationUtil.dataNotNull(logId, "日志id不允许为空!"); ValidationUtil.dataNotNull(logId, "日志id不允许为空!");
log.info("请求杀死任务,对应logId:【{}】", logId); log.info("请求杀死任务,对应logId:【{}】", logId);
MythJobProcess mythJobProcess = JobContentUtil.getJobThread(logId); JobContentUtil.kill(logId);
ValidationUtil.dataNotNull(mythJobProcess, logId + "已经运行结束或还未调用!");
mythJobProcess.hardKill();
return "SUCCESS"; return "SUCCESS";
} }
} }
...@@ -48,4 +48,10 @@ public class JobContentUtil { ...@@ -48,4 +48,10 @@ public class JobContentUtil {
} }
} }
public static void kill(Integer logId){
MythJobProcess mythJobProcess = JobContentUtil.getJobThread(logId);
ValidationUtil.dataNotNull(mythJobProcess, logId + "已经运行结束或还未调用!");
mythJobProcess.hardKill();
}
} }
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